summaryrefslogtreecommitdiff
path: root/framework/TComponent.php
diff options
context:
space:
mode:
authorctrlaltca@gmail.com <>2011-06-26 09:56:56 +0000
committerctrlaltca@gmail.com <>2011-06-26 09:56:56 +0000
commit8dc9d4f7d49bcbeaf4998baf74a4f4459967c1f0 (patch)
treef2a1a3ddb20418e78e4f0b445866ac2605bff736 /framework/TComponent.php
parentf5a87398433ebecefbc62d4fead8a178e32a1f26 (diff)
applied serialization optimization patch (337)
Diffstat (limited to 'framework/TComponent.php')
-rw-r--r--framework/TComponent.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/framework/TComponent.php b/framework/TComponent.php
index ea204011..dbcf4a60 100644
--- a/framework/TComponent.php
+++ b/framework/TComponent.php
@@ -451,6 +451,31 @@ class TComponent
public function addParsedObject($object)
{
}
+
+ /**
+ * Do not call this method. This is a PHP magic method that will be called automatically
+ * after any unserialization; it can perform reinitialization tasks on the object.
+ */
+ public function __wakeup()
+ {
+ if ($this->_e===null)
+ $this->_e = array();
+ }
+
+ /**
+ * Returns an array with the names of all variables of that object that should be serialized.
+ * Do not call this method. This is a PHP magic method that will be called automatically
+ * prior to any serialization.
+ */
+ public function __sleep()
+ {
+ $a = (array)$this;
+ $a = array_keys($a);
+ $exprops = array();
+ if ($this->_e===array())
+ $exprops[] = "\0TComponent\0_e";
+ return array_diff($a,$exprops);
+ }
}
/**