Fixed the autoload issue when unserializing objects stored in the session. Added in the freeze / thaw methods for storing singleton objects in the session for later retrieval.
git-svn-id: http://svn.cleancode.org/svn/pickles@36 4d10bc64-7434-11dc-a737-d2d0f8310089
This commit is contained in:
parent
5198febae5
commit
66338a66bb
5 changed files with 56 additions and 24 deletions
|
@ -4,14 +4,13 @@ class Session extends Singleton {
|
|||
|
||||
private static $instance;
|
||||
|
||||
public $id = null;
|
||||
public static $id = null;
|
||||
|
||||
private function __construct() {
|
||||
if (ini_get('session.auto_start') == 0) {
|
||||
session_start();
|
||||
$this->id = session_id();
|
||||
}
|
||||
|
||||
$this->id = session_id();
|
||||
}
|
||||
|
||||
public static function getInstance() {
|
||||
|
@ -43,7 +42,7 @@ class Session extends Singleton {
|
|||
return $_SESSION[$var];
|
||||
}
|
||||
|
||||
function __set($var,$val) {
|
||||
function __set($var, $val) {
|
||||
return ($_SESSION[$var] = $val);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue