Index: branches/5.1.x/core/units/helpers/xml_helper5.php =================================================================== diff -u -r14025 -r14241 --- branches/5.1.x/core/units/helpers/xml_helper5.php (.../xml_helper5.php) (revision 14025) +++ branches/5.1.x/core/units/helpers/xml_helper5.php (.../xml_helper5.php) (revision 14241) @@ -1,83 +1,83 @@ -var = $array; - } - } - - public function rewind() - { - reset($this->var); - } - - public function current() - { - $var = current($this->var); - return $var; - } - - public function key() - { - $var = key($this->var); - - return $var; - } - - public function next() - { - $var = next($this->var); - - return $var; - } - - public function valid() - { - $var = $this->current() !== false; - - return $var; - } -} - -class kXMLNode5 extends kXMLNode implements IteratorAggregate { - - public function getIterator() - { - $ret = new XMLIterator($this->Children); - - return $ret; - } - - public function __destruct() - { -// echo number_format(memory_get_usage()). ' <-- Entered destructor for '.$this->Name.'
'; - unset($this->Attributes, $this->OriginalAttributes); - - if ( isset($this->Children) ) { - foreach ($this->Children as $key => $child) { - if ( $this->Children[$key] instanceof kXMLNode5 ) { - $this->Children[$key]->__destruct(); - } - - unset( $this->Children[$key] ); - } - } - - unset($this->Children); -// echo number_format(memory_get_usage()). ' <-- Destructed '.$this->Name.' Children
'; - unset($this->Name, $this->OriginalName); - unset($this->Data); - unset($this->firstChild); - unset($this->lastChild); - unset($this->Parent); - unset($this->Position); - unset($this->CRC); - unset($this); - } -} - +var = $array; + } + } + + public function rewind() + { + reset($this->var); + } + + public function current() + { + $var = current($this->var); + return $var; + } + + public function key() + { + $var = key($this->var); + + return $var; + } + + public function next() + { + $var = next($this->var); + + return $var; + } + + public function valid() + { + $var = $this->current() !== false; + + return $var; + } +} + +class kXMLNode5 extends kXMLNode implements IteratorAggregate { + + public function getIterator() + { + $ret = new XMLIterator($this->Children); + + return $ret; + } + + public function __destruct() + { +// echo number_format(memory_get_usage()). ' <-- Entered destructor for '.$this->Name.'
'; + unset($this->Attributes, $this->OriginalAttributes); + + if ( isset($this->Children) ) { + foreach ($this->Children as $key => $child) { + if ( $this->Children[$key] instanceof kXMLNode5 ) { + $this->Children[$key]->__destruct(); + } + + unset( $this->Children[$key] ); + } + } + + unset($this->Children); +// echo number_format(memory_get_usage()). ' <-- Destructed '.$this->Name.' Children
'; + unset($this->Name, $this->OriginalName); + unset($this->Data); + unset($this->firstChild); + unset($this->lastChild); + unset($this->Parent); + unset($this->Position); + unset($this->CRC); + unset($this); + } +} +