无论有没有账号密码,连接方式不都应该是统一的吗?
在查看 Yii2 的 Memcached 驱动文件时,发现在有账号密码的情况下,进行二进制连接,否则进行的是简单连接。
Yii2 版本:2.0.13
位置:vendor/yiisoft/yii2/caching/MemCache.php:225
if ($this->useMemcached) {    $this->_cache = $this->persistentId !== null ? new \Memcached($this->persistentId) : new \Memcached();    if ($this->username !== null || $this->password !== null) {        $this->_cache->setOption(\Memcached::OPT_BINARY_PROTOCOL, true);        $this->_cache->setSaslAuthData($this->username, $this->password);
    }
潇湘沐
					汪汪一只猫
随时随地看视频慕课网APP