pull origin

This commit is contained in:
RichWeber
2014-08-01 00:32:08 +03:00
parent 5a8bd4747d
commit 92cd13a913
411 changed files with 4872 additions and 1587 deletions

View File

@@ -82,6 +82,17 @@ class MemCache extends Cache
* @see http://ca2.php.net/manual/en/memcached.setoptions.php
*/
public $options;
/**
* @var string memcached sasl username. This property is used only when [[useMemcached]] is true.
* @see http://php.net/manual/en/memcached.setsaslauthdata.php
*/
public $username;
/**
* @var string memcached sasl password. This property is used only when [[useMemcached]] is true.
* @see http://php.net/manual/en/memcached.setsaslauthdata.php
*/
public $password;
/**
* @var \Memcache|\Memcached the Memcache instance
*/
@@ -200,6 +211,10 @@ class MemCache extends Cache
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);
}
if (!empty($this->options)) {
$this->_cache->setOptions($this->options);
}