From 4f4eb5445b36def36e1fe4a574dd884543573d0a Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 7 Jul 2016 12:12:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3sqlite=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E9=A9=B1=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/cache/driver/Memcached.php | 21 ++++++++++----------- library/think/cache/driver/Sqlite.php | 2 +- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/library/think/cache/driver/Memcached.php b/library/think/cache/driver/Memcached.php index 93e58267..50082a1e 100644 --- a/library/think/cache/driver/Memcached.php +++ b/library/think/cache/driver/Memcached.php @@ -12,19 +12,18 @@ namespace think\cache\driver; use think\Cache; -use think\Exception; class Memcached { - protected $handler = null; + protected $handler; protected $options = [ - 'host' => '127.0.0.1', - 'port' => 11211, - 'expire' => 0, - 'timeout' => 0, // 超时时间(单位:毫秒) - 'prefix' => '', - 'username' => '', //账号 - 'password' => '', //密码 + 'host' => '127.0.0.1', + 'port' => 11211, + 'expire' => 0, + 'timeout' => 0, // 超时时间(单位:毫秒) + 'prefix' => '', + 'username' => '', //账号 + 'password' => '', //密码 ]; /** @@ -57,9 +56,9 @@ class Memcached $servers[] = [$host, (isset($ports[$i]) ? $ports[$i] : $ports[0]), 1]; } $this->handler->addServers($servers); - if('' != $this->options['username']){ + if ('' != $this->options['username']) { $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']); } } diff --git a/library/think/cache/driver/Sqlite.php b/library/think/cache/driver/Sqlite.php index 8a7c19aa..e4689d61 100644 --- a/library/think/cache/driver/Sqlite.php +++ b/library/think/cache/driver/Sqlite.php @@ -18,7 +18,7 @@ use think\Exception; * Sqlite缓存驱动 * @author liu21st */ -class Sqlite implements CacheInterface +class Sqlite { protected $options = [