From ca71a4e3c78f6cbc8ee96d46153ec46731ac893d Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 1 Sep 2016 14:04:27 +0800 Subject: [PATCH] =?UTF-8?q?memcached=E9=A9=B1=E5=8A=A8=E7=9A=84=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=8F=82=E6=95=B0=E6=94=AF=E6=8C=81option=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/cache/driver/Memcached.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/think/cache/driver/Memcached.php b/library/think/cache/driver/Memcached.php index 9c0a2597..5857edce 100644 --- a/library/think/cache/driver/Memcached.php +++ b/library/think/cache/driver/Memcached.php @@ -24,6 +24,7 @@ class Memcached extends Driver 'prefix' => '', 'username' => '', //账号 'password' => '', //密码 + 'option' => [], ]; /** @@ -40,6 +41,9 @@ class Memcached extends Driver $this->options = array_merge($this->options, $options); } $this->handler = new \Memcached; + if (!empty($this->options['option'])) { + $this->handler->setOptions($this->options['option']); + } // 设置连接超时时间(单位:毫秒) if ($this->options['timeout'] > 0) { $this->handler->setOption(\Memcached::OPT_CONNECT_TIMEOUT, $this->options['timeout']);