diff --git a/convention.php b/convention.php index fda103a3..09fff046 100644 --- a/convention.php +++ b/convention.php @@ -73,8 +73,6 @@ return [ 'url_route_on' => true, // 是否强制使用路由 'url_route_must' => false, - // URL模块映射 - 'url_module_map' => [], // 域名部署 'url_domain_deploy' => false, // 域名根,如.thinkphp.cn diff --git a/library/think/session/driver/Redis.php b/library/think/session/driver/Redis.php index b07289dd..96389fe0 100644 --- a/library/think/session/driver/Redis.php +++ b/library/think/session/driver/Redis.php @@ -18,13 +18,13 @@ class Redis extends SessionHandler { protected $handler = null; protected $config = [ - 'host' => '127.0.0.1', // redis主机 - 'port' => 6379, // redis端口 - 'password' => '', // 密码 - 'expire' => 3600, // 有效期(秒) - 'timeout' => 0, // 超时时间(秒) - 'persistent' => true, // 是否长连接 - 'session_name' => '', // sessionkey前缀 + 'host' => '127.0.0.1', // redis主机 + 'port' => 6379, // redis端口 + 'password' => '', // 密码 + 'expire' => 3600, // 有效期(秒) + 'timeout' => 0, // 超时时间(秒) + 'persistent' => true, // 是否长连接 + 'session_name' => '', // sessionkey前缀 ]; public function __construct($config = []) @@ -45,11 +45,11 @@ class Redis extends SessionHandler throw new Exception('_NOT_SUPPERT_:redis'); } $this->handler = new \Redis; - + // 建立连接 $func = $this->config['persistent'] ? 'pconnect' : 'connect'; $this->handler->$func($this->config['host'], $this->config['port'], $this->config['timeout']); - + if ('' != $this->config['password']) { $this->handler->auth($this->config['password']); } @@ -100,7 +100,7 @@ class Redis extends SessionHandler */ public function destroy($sessID) { - return $this->handler->delete($this->config['session_name'] . $sessID); + return $this->handler->delete($this->config['session_name'] . $sessID) ? true : false; } /**