Skip to content
Permalink
Browse files

Remove \ and replace with use.

Refs #3957
  • Loading branch information...
markstory committed Jul 13, 2014
1 parent 5d41eb1 commit 42e77f85eebfdd978d235a031baf3e5f2d4eae16
Showing with 11 additions and 10 deletions.
  1. +11 −10 src/Cache/Engine/MemcachedEngine.php
@@ -17,6 +17,7 @@
use Cake\Cache\CacheEngine;
use Cake\Error;
use Cake\Utility\Inflector;
use \Memcached;
/**
* Memcached storage engine for cache. Memcached has some limitations in the amount of
@@ -105,12 +106,12 @@ public function init(array $config = []) {
}
$this->_serializers = [
'igbinary' => \Memcached::SERIALIZER_IGBINARY,
'json' => \Memcached::SERIALIZER_JSON,
'php' => \Memcached::SERIALIZER_PHP
'igbinary' => Memcached::SERIALIZER_IGBINARY,
'json' => Memcached::SERIALIZER_JSON,
'php' => Memcached::SERIALIZER_PHP
];
if (defined('Memcached::HAVE_MSGPACK') && \Memcached::HAVE_MSGPACK) {
$this->_serializers['msgpack'] = \Memcached::SERIALIZER_MSGPACK;
if (defined('Memcached::HAVE_MSGPACK') && Memcached::HAVE_MSGPACK) {
$this->_serializers['msgpack'] = Memcached::SERIALIZER_MSGPACK;
}
parent::init($config);
@@ -127,7 +128,7 @@ public function init(array $config = []) {
return true;
}
$this->_Memcached = new \Memcached($this->_config['persistent'] ? (string)$this->_config['persistent'] : null);
$this->_Memcached = new Memcached($this->_config['persistent'] ? (string)$this->_config['persistent'] : null);
$this->_setOptions();
if (count($this->_Memcached->getServerList())) {
@@ -168,7 +169,7 @@ public function init(array $config = []) {
* @throws \Cake\Error\Exception when the Memcached extension is not built with the desired serializer engine
*/
protected function _setOptions() {
$this->_Memcached->setOption(\Memcached::OPT_LIBKETAMA_COMPATIBLE, true);
$this->_Memcached->setOption(Memcached::OPT_LIBKETAMA_COMPATIBLE, true);
$serializer = strtolower($this->_config['serialize']);
if (!isset($this->_serializers[$serializer])) {
@@ -183,14 +184,14 @@ protected function _setOptions() {
);
}
$this->_Memcached->setOption(\Memcached::OPT_SERIALIZER, $this->_serializers[$serializer]);
$this->_Memcached->setOption(Memcached::OPT_SERIALIZER, $this->_serializers[$serializer]);
// Check for Amazon ElastiCache instance
if (defined('Memcached::OPT_CLIENT_MODE') && defined('Memcached::DYNAMIC_CLIENT_MODE')) {
$this->_Memcached->setOption(\Memcached::OPT_CLIENT_MODE, \Memcached::DYNAMIC_CLIENT_MODE);
$this->_Memcached->setOption(Memcached::OPT_CLIENT_MODE, Memcached::DYNAMIC_CLIENT_MODE);
}
$this->_Memcached->setOption(\Memcached::OPT_COMPRESSION, (bool)$this->_config['compress']);
$this->_Memcached->setOption(Memcached::OPT_COMPRESSION, (bool)$this->_config['compress']);
}
/**

0 comments on commit 42e77f8

Please sign in to comment.
You can’t perform that action at this time.