Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F802480
in-portal
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Feb 24, 6:47 AM
Size
2 KB
Mime Type
text/x-diff
Expires
Wed, Feb 26, 6:47 AM (1 d, 14 h)
Engine
blob
Format
Raw Data
Handle
575394
Attached To
rINP In-Portal
in-portal
View Options
Index: branches/5.1.x/core/units/helpers/xml_helper5.php
===================================================================
--- branches/5.1.x/core/units/helpers/xml_helper5.php (revision 14024)
+++ branches/5.1.x/core/units/helpers/xml_helper5.php (revision 14025)
@@ -1,71 +1,83 @@
<?php
-class XMLIterator implements Iterator
+class XMLIterator implements Iterator
{
private $var = array();
- public function __construct($array)
- {
- if (is_array($array)) {
- $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;
- }
-
+ public function __construct($array)
+ {
+ if ( is_array($array) ) {
+ $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() {
- return new XMLIterator($this->Children);
+ public function getIterator()
+ {
+ $ret = new XMLIterator($this->Children);
+
+ return $ret;
}
-
+
public function __destruct()
{
// echo number_format(memory_get_usage()). ' <-- Entered destructor for '.$this->Name.'<br/>';
- unset($this->Attributes);
- if (is_array($this->Children)) {
- foreach ($this->Children as $key => $child)
- {
- if ($this->Children[$key] instanceof kXMLNode5 ) {
+ 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[$key] );
}
}
+
unset($this->Children);
// echo number_format(memory_get_usage()). ' <-- Destructed '.$this->Name.' Children <br/>';
- unset($this->Name);
+ 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);
}
}
Event Timeline
Log In to Comment