function testSaveCustomModeMongoSession() { global $links; Session::$hook = 'custom'; Session::$source = 'mongo'; Session::$link = $links['mongo']; $session = new Session($links['mongo']); $session->set('foo', 'bar'); $this->assertEqual($session->get('foo'), 'bar'); $session->shutdown(); $this->assertNotEqual($session->get('foo'), 'bar'); $session = new Session($links['mongo']); $this->assertEqual($session->get('foo'), 'bar'); $session->shutdown(); }
public static function shutdown() { Session::shutdown(); }
Session::init(); // Set the locale from the user info else config, database, then default english locale if (User::identify()->loggedin && User::identify()->info->locale_lang) { Locale::set(User::identify()->info->locale_lang); } else { Locale::set(Config::get('locale', Options::get('locale', 'en-us'))); } if (Options::get('system_locale')) { Locale::set_system_locale(Options::get('system_locale')); } // Replace the $_COOKIE superglobal with an object representation SuperGlobal::process_c(); // Initiating request handling, tell the plugins. Plugins::act('init'); // Load Stack Items Stack::load_stackitems(); if (defined('SUPPRESS_REQUEST')) { return; } // Parse and handle the request. Controller::parse_request(); // Run the cron jobs asyncronously. CronHandler::run_cron(Config::get('cron_async', true)); // Dispatch the request (action) to the matched handler. Controller::dispatch_request(); // Shut down sessions so they can write and send cookies and headers before output, but after everything should be done Session::shutdown(); // Flush (send) the output buffer. $buffer = ob_get_clean(); $buffer = Plugins::filter('final_output', $buffer); echo $buffer;