From d42b25cbf6d3f1e51cb2a3149f1ff54cc5474bc9 Mon Sep 17 00:00:00 2001 From: emkael Date: Thu, 7 Apr 2016 16:09:16 +0200 Subject: * Prado upgrade (to 3.3.r6b8e6601752b21a8a96c385a5529bbec7bb2b408) --- lib/prado/framework/TComponent.php | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'lib/prado/framework/TComponent.php') diff --git a/lib/prado/framework/TComponent.php b/lib/prado/framework/TComponent.php index 5901f93..127b68a 100644 --- a/lib/prado/framework/TComponent.php +++ b/lib/prado/framework/TComponent.php @@ -8,7 +8,7 @@ * @author Brad Anderson * * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System */ @@ -1697,16 +1697,6 @@ class TComponent return null; } - /** - * 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 @@ -1717,6 +1707,18 @@ class TComponent $a = (array)$this; $a = array_keys($a); $exprops = array(); + $this->_getZappableSleepProps($exprops); + return array_diff($a, $exprops); + } + + /** + * Returns an array with the names of all variables of this object that should NOT be serialized + * because their value is the default one or useless to be cached for the next page loads. + * Reimplement in derived classes to add new variables, but remember to also to call the parent + * implementation first. + */ + protected function _getZappableSleepProps(&$exprops) + { if($this->_listeningenabled===false) $exprops[] = "\0TComponent\0_listeningenabled"; if($this->_behaviorsenabled===true) @@ -1725,7 +1727,6 @@ class TComponent $exprops[] = "\0TComponent\0_e"; if ($this->_m===null) $exprops[] = "\0TComponent\0_m"; - return array_diff($a,$exprops); } } -- cgit v1.2.3