mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 09:41:40 +09:00
NOISSUE code rearrange
This commit is contained in:
parent
b146e48ff5
commit
bc47f19615
22 changed files with 130 additions and 159 deletions
|
|
@ -32,7 +32,7 @@ class GeneralXmlParser
|
|||
xml_parse($oParser, $input);
|
||||
xml_parser_free($oParser);
|
||||
|
||||
if(!count($this->output))
|
||||
if(count($this->output) < 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -50,11 +50,12 @@ class GeneralXmlParser
|
|||
*/
|
||||
function _tagOpen($parser, $node_name, $attrs)
|
||||
{
|
||||
$obj = new stdClass();
|
||||
$obj->node_name = strtolower($node_name);
|
||||
$obj->attrs = $attrs;
|
||||
$obj->childNodes = array();
|
||||
|
||||
array_push($this->output, $obj);
|
||||
$this->output[] = $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -81,24 +82,22 @@ class GeneralXmlParser
|
|||
$node_name = strtolower($node_name);
|
||||
$cur_obj = array_pop($this->output);
|
||||
$parent_obj = &$this->output[count($this->output) - 1];
|
||||
$tmp_obj = &$parent_obj->childNodes[$node_name];
|
||||
|
||||
if($parent_obj->childNodes[$node_name])
|
||||
if($tmp_obj)
|
||||
{
|
||||
$tmp_obj = $parent_obj->childNodes[$node_name];
|
||||
if(is_array($tmp_obj))
|
||||
{
|
||||
array_push($parent_obj->childNodes[$node_name], $cur_obj);
|
||||
$tmp_obj[] = $cur_obj;
|
||||
}
|
||||
else
|
||||
{
|
||||
$parent_obj->childNodes[$node_name] = array();
|
||||
array_push($parent_obj->childNodes[$node_name], $tmp_obj);
|
||||
array_push($parent_obj->childNodes[$node_name], $cur_obj);
|
||||
$tmp_obj = array($tmp_obj, $cur_obj);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$parent_obj->childNodes[$node_name] = $cur_obj;
|
||||
$tmp_obj = $cur_obj;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ class XmlParser
|
|||
$obj->node_name = strtolower($node_name);
|
||||
$obj->attrs = $this->_arrToAttrsObj($attrs);
|
||||
|
||||
array_push($this->output, $obj);
|
||||
$this->output[] = $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -203,13 +203,11 @@ class XmlParser
|
|||
$tmp_obj = $parent_obj->{$node_name};
|
||||
if(is_array($tmp_obj))
|
||||
{
|
||||
array_push($parent_obj->{$node_name}, $cur_obj);
|
||||
$parent_obj->{$node_name}[] = $cur_obj;
|
||||
}
|
||||
else
|
||||
{
|
||||
$parent_obj->{$node_name} = array();
|
||||
array_push($parent_obj->{$node_name}, $tmp_obj);
|
||||
array_push($parent_obj->{$node_name}, $cur_obj);
|
||||
$parent_obj->{$node_name} = array($tmp_obj, $cur_obj);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue