mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 15:12:48 +08:00
修正sqlite缓存驱动
This commit is contained in:
21
library/think/cache/driver/Memcached.php
vendored
21
library/think/cache/driver/Memcached.php
vendored
@@ -12,19 +12,18 @@
|
|||||||
namespace think\cache\driver;
|
namespace think\cache\driver;
|
||||||
|
|
||||||
use think\Cache;
|
use think\Cache;
|
||||||
use think\Exception;
|
|
||||||
|
|
||||||
class Memcached
|
class Memcached
|
||||||
{
|
{
|
||||||
protected $handler = null;
|
protected $handler;
|
||||||
protected $options = [
|
protected $options = [
|
||||||
'host' => '127.0.0.1',
|
'host' => '127.0.0.1',
|
||||||
'port' => 11211,
|
'port' => 11211,
|
||||||
'expire' => 0,
|
'expire' => 0,
|
||||||
'timeout' => 0, // 超时时间(单位:毫秒)
|
'timeout' => 0, // 超时时间(单位:毫秒)
|
||||||
'prefix' => '',
|
'prefix' => '',
|
||||||
'username' => '', //账号
|
'username' => '', //账号
|
||||||
'password' => '', //密码
|
'password' => '', //密码
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -57,9 +56,9 @@ class Memcached
|
|||||||
$servers[] = [$host, (isset($ports[$i]) ? $ports[$i] : $ports[0]), 1];
|
$servers[] = [$host, (isset($ports[$i]) ? $ports[$i] : $ports[0]), 1];
|
||||||
}
|
}
|
||||||
$this->handler->addServers($servers);
|
$this->handler->addServers($servers);
|
||||||
if('' != $this->options['username']){
|
if ('' != $this->options['username']) {
|
||||||
$this->handler->setOption(\Memcached::OPT_BINARY_PROTOCOL, true);
|
$this->handler->setOption(\Memcached::OPT_BINARY_PROTOCOL, true);
|
||||||
$this->handler->setSaslAuthData($this->options['username'], $this->options['password']);
|
$this->handler->setSaslAuthData($this->options['username'], $this->options['password']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2
library/think/cache/driver/Sqlite.php
vendored
2
library/think/cache/driver/Sqlite.php
vendored
@@ -18,7 +18,7 @@ use think\Exception;
|
|||||||
* Sqlite缓存驱动
|
* Sqlite缓存驱动
|
||||||
* @author liu21st <liu21st@gmail.com>
|
* @author liu21st <liu21st@gmail.com>
|
||||||
*/
|
*/
|
||||||
class Sqlite implements CacheInterface
|
class Sqlite
|
||||||
{
|
{
|
||||||
|
|
||||||
protected $options = [
|
protected $options = [
|
||||||
|
|||||||
Reference in New Issue
Block a user