protected function __construct($cacheid)
{
$this->_cacheid = $cacheid;
+ register_shutdown_function(array($this, 'shutdown'));
}
/**
* Store a serialized version of ourself in the current session on
* shutdown.
*/
- public function __destruct()
+ public function shutdown()
{
if ($this->_modified) {
$this->_modified = false;
/* Rebuild the Horde_Imap_Client object. */
$this->_loadImapObject();
+
+ register_shutdown_function(array($this, 'shutdown'));
}
/**
* Save the Horde_Imap_Client object on session shutdown.
*/
- public function __destruct()
+ public function shutdown()
{
/* Only need to serialize object once a session. When we do
* serialize, make sure we login in order to ensure we have done the
}
$this->init();
+ $this->__wakeup();
}
/**
}
/**
+ * Tasks to do on wakeup.
+ */
+ public function __wakeup()
+ {
+ register_shutdown_function(array($this, 'shutdown'));
+ }
+
+ /**
* Store a serialized version of ourself in the current session.
*/
- public function __destruct()
+ public function shutdown()
{
/* We only need to store the object if using Horde_Cache and the tree
* has changed. */
}
$this->setIndex($uid);
}
+
+ register_shutdown_function(array($this, 'shutdown'));
}
/**
* list, and to ensure messages aren't marked as missing in search
* mailboxes (e.g. if search is dependent on unseen flag).
*/
- public function __destruct()
+ public function shutdown()
{
if (!is_null($this->_arrayIndex)) {
/* Casting $_sorted to integers saves a significant amount of
}
/**
- * Destructor.
+ * Constructor.
*/
- public function __destruct()
+ public function __construct()
+ {
+ register_shutdown_function(array($this, 'shutdown'));
+ }
+
+ /**
+ * Shutdown function.
+ */
+ public function shutdown()
{
$cache = Horde_SessionObjects::singleton();
public function __construct($params = array())
{
$this->_params = $params;
+ parent::__construct();
}
/**
/* Default to the same DB handle for the writer too. */
$this->_db =& $this->_write_db;
}
+
+ parent::__construct();
}
/**