public static function setup($domain, $prefix, $host, $port, $ttl) { self::$domain = $domain; self::$prefix = $prefix; self::$console = Console::create('session'); self::$ttl = $ttl; self::$mem = new Memcache(); self::$mem->pconnect($host, $port); self::$console->log('Connecting:', $host . ':' . $port, '[ttl:' . $ttl . 's]'); }
private function __construct() { //Session::$ttl = ConfigHandler::getValue('session', 'ttl'); Session::$ttl = defined('SESSION_TTL') ? SESSION_TTL : 3600; // Set the save handlers session_set_save_handler(array('Session', "start"), array('Session', "end"), array('Session', "read"), array('Session', "write"), array('Session', "destroy"), array('Session', "gc")); Session::gc(); // Only start a new session if there is not already one. if (!isset($_SESSION)) { session_start(); } // Possibly give a notice or something if it's started previously... or maybe not, shrug. }