From eb5c0cc2715d77dc16a6cfbb64e2503d168367d0 Mon Sep 17 00:00:00 2001 From: ctrlaltca <> Date: Wed, 28 Nov 2012 09:35:01 +0000 Subject: TComponent: strip out in __sleep() variables that doesn't need to be saved (because they did not change from their default values) when the class gets serialized. References #337 This definitely needs better handling of subclasses properties --- framework/TComponent.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'framework') diff --git a/framework/TComponent.php b/framework/TComponent.php index 95fc2855..f1a5503f 100644 --- a/framework/TComponent.php +++ b/framework/TComponent.php @@ -1721,8 +1721,14 @@ class TComponent $a = (array)$this; $a = array_keys($a); $exprops = array(); + if($this->_listeningenabled===false) + $exprops[] = "\0TComponent\0_listeningenabled"; + if($this->_behaviorsenabled===true) + $exprops[] = "\0TComponent\0_behaviorsenabled"; if ($this->_e===array()) $exprops[] = "\0TComponent\0_e"; + if ($this->_m===null) + $exprops[] = "\0TComponent\0_m"; return array_diff($a,$exprops); } } -- cgit v1.2.3