/** * @return true/false according to cache system being installed */ public static function cacheSession($prefix = 'dooSession/', $type = 'file') { $cache = self::cache($type); self::loadCore('session/DooCacheSession'); return DooCacheSession::installOnCache($cache, $prefix); }
/** * Install session managment on given $cacheSystem, with given $prefix * * @return boolean status of installtaion */ public static function installOnCache(&$cacheSystem, $prefix = null) { ini_set('session.save_handler', 'user'); self::$lifetime = ini_get('session.gc_maxlifetime'); self::$cache = $cacheSystem; if (is_string($prefix)) { self::$sessionPrefix = $prefix; } return session_set_save_handler(array(__CLASS__, "open"), array(__CLASS__, "close"), array(__CLASS__, "read"), array(__CLASS__, "write"), array(__CLASS__, "destroy"), array(__CLASS__, "gc")); }