public function __construct($config) { $redis_config = array('tcp' => $config->redis->tcp, 'host' => $config->redis->host, 'port' => $config->redis->port, 'database' => $config->redis->database); $this->_redis_handler = Cache::getInstance($redis_config); //session前缀 if (isset($config->redis->cache_key_prefix)) { $this->_cache_key_prefix = $config->redis->cache_key_prefix; } parent::__construct(); }
<?php //Session_Handler::destroySession(); Session_Handler::checkSession(); $user = new User(); //$user->setUserName("d"); //$user->setPassword("asdf"); $d = $user->readAllDatabase(); $result = $user->readDatabase('where username=? and password=?', array('asdf', 'asdf')); print_r($result); echo key($_GET); echo $user->isExist(); print_r($user); echo $user::isLogin(); print_r($user); /* if ($user->isExist()) { echo "login"; } else { echo "no user!"; } */
public static function changeLocale($locale, $session) { Session_Handler::checkSession(); $_SESSION["locale"] = setlocale(LC_ALL, $locale); }
public function __construct($config) { parent::__construct(); }