[pLog-svn] r2084 - plog/branches/plog-1.0.2/class/dao

oscar at devel.plogworld.net oscar at devel.plogworld.net
Fri May 27 13:49:30 GMT 2005


Author: oscar
Date: 2005-05-27 13:49:29 +0000 (Fri, 27 May 2005)
New Revision: 2084

Modified:
   plog/branches/plog-1.0.2/class/dao/bloginfo.class.php
Log:
solved issue 556 (http://bugs.plogworld.net/view.php?id=556) -- too much
data serialized in the session (the Locale object was being saved too!)


Modified: plog/branches/plog-1.0.2/class/dao/bloginfo.class.php
===================================================================
--- plog/branches/plog-1.0.2/class/dao/bloginfo.class.php	2005-05-27 13:30:51 UTC (rev 2083)
+++ plog/branches/plog-1.0.2/class/dao/bloginfo.class.php	2005-05-27 13:49:29 UTC (rev 2084)
@@ -534,5 +534,19 @@
 
             return true;
         }
+        
+        /**
+         * @private
+         *
+         * Special method used for serialization where we avoid saving the Locale object to the
+         * session, which makes session size increase almost to 70kb in some situations! Instead of telling
+         * php not to serialize "_locale", we just set the reference to null and tell php to save everything. The
+         * Locale will need to be loaded later on but that's just fine.
+         */
+        function __sleep()
+        {
+	        $this->_locale = null;
+	        return( array_keys( get_object_vars( &$this )));
+        }
     }
 ?>




More information about the pLog-svn mailing list