public static function initForTests() { Kwf_Session::start(); Kwf_Util_MemoryLimit::set(512); Kwf_Component_Data_Root::setComponentClass(false); Zend_Registry::set('db', Kwf_Test::getTestDb()); set_time_limit(0); Kwf_Benchmark::disable(); }
public function start() { \Kwf_Session::start(); if ($this->started) { return true; } $this->loadSession(); //if (!$this->saveHandler->isWrapper() && !$this->saveHandler->isSessionHandlerInterface()) { // // This condition matches only PHP 5.3 + internal save handlers // $this->saveHandler->setActive(true); //} return true; }
public function replaceOutput($renderer) { $facebook = Kwf_Util_Facebook_Api::getInstance(); //no redirect if cli, or address contains assets, admin or kwf if (PHP_SAPI != 'cli' && !preg_match('#^/admin|^/kwf|^/assets#', $_SERVER['REQUEST_URI'])) { if (!isset($_COOKIE[session_name()])) { Kwf_Session::start(); if (!isset($_COOKIE[session_name()])) { $serverDomain = 'http://' . Kwf_Config::getValue('server.domain'); return "<script>top.location.href=\"{$serverDomain}/home\";</script>"; } } } return false; }