mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-05 14:52:47 +08:00
Merge branch 'master' of https://github.com/top-think/framework
This commit is contained in:
2
library/think/cache/driver/File.php
vendored
2
library/think/cache/driver/File.php
vendored
@@ -109,7 +109,7 @@ class File extends Driver
|
||||
$content = file_get_contents($filename);
|
||||
if (false !== $content) {
|
||||
$expire = (int) substr($content, 8, 12);
|
||||
if (0 != $expire && $_SERVER['REQUEST_TIME'] > filemtime($filename) + $expire) {
|
||||
if (0 != $expire && time() > filemtime($filename) + $expire) {
|
||||
return $default;
|
||||
}
|
||||
$content = substr($content, 32);
|
||||
|
||||
7
library/think/cache/driver/Redis.php
vendored
7
library/think/cache/driver/Redis.php
vendored
@@ -46,9 +46,12 @@ class Redis extends Driver
|
||||
if (!empty($options)) {
|
||||
$this->options = array_merge($this->options, $options);
|
||||
}
|
||||
$func = $this->options['persistent'] ? 'pconnect' : 'connect';
|
||||
$this->handler = new \Redis;
|
||||
$this->handler->$func($this->options['host'], $this->options['port'], $this->options['timeout']);
|
||||
if ($this->options['persistent']) {
|
||||
$this->handler->pconnect($this->options['host'], $this->options['port'], $this->options['timeout'], 'persistent_id_' . $this->options['select']);
|
||||
} else {
|
||||
$this->handler->connect($this->options['host'], $this->options['port'], $this->options['timeout']);
|
||||
}
|
||||
|
||||
if ('' != $this->options['password']) {
|
||||
$this->handler->auth($this->options['password']);
|
||||
|
||||
Reference in New Issue
Block a user