From 2007e69d4fc7100cfdc682491056a06b05196770 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Skej=C3=B8?= Date: Sun, 23 Nov 2008 19:50:00 +0100 Subject: [PATCH] Defined __sleep and __wakeup --- AOOSCore.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/AOOSCore.php b/AOOSCore.php index aea5403..490ab73 100644 --- a/AOOSCore.php +++ b/AOOSCore.php @@ -26,9 +26,12 @@ class AOOSCore */ public function __construct() { + // Settings require_once("config.php"); $this->_settings = $settings; /* Set in config.php */ $l = $this->getSetting("lang"); + + // Translated strings require_once("lang.php"); if (!in_array($l, array_keys($lang))) /* $lang set in lang.php */ { @@ -49,6 +52,18 @@ class AOOSCore $this->log("Created AOOSCore"); } + public function __sleep() { + print __function__."() called!
"; + $_SESSION["modules"] = serialize($this->_modules); + $this->_modules = null; + return array("_exceptions", "_modules", "_settings"); + } + + public function __wakeup() { + $this->_modules = unserialize($_SESSION["modules"]); + $_SESSION["modules"] = false; + } + public function log($str) { $this->_log[] = array( -- 2.11.4.GIT