mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Change $serializer visibility, and other fix
This commit is contained in:
parent
d099c5ad7e
commit
85e5ef4d4e
1 changed files with 6 additions and 6 deletions
|
@ -51,13 +51,13 @@ class MemcachedEngine extends CacheEngine {
|
||||||
public $settings = array();
|
public $settings = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of available serializer engine
|
* List of available serializer engines
|
||||||
*
|
*
|
||||||
* Memcached must be compiled with json and igbinary support to use these engines
|
* Memcached must be compiled with json and igbinary support to use these engines
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public static $serializer = array(
|
protected $_serializers = array(
|
||||||
'igbinary' => Memcached::SERIALIZER_IGBINARY,
|
'igbinary' => Memcached::SERIALIZER_IGBINARY,
|
||||||
'json' => Memcached::SERIALIZER_JSON,
|
'json' => Memcached::SERIALIZER_JSON,
|
||||||
'php' => Memcached::SERIALIZER_PHP
|
'php' => Memcached::SERIALIZER_PHP
|
||||||
|
@ -135,17 +135,17 @@ class MemcachedEngine extends CacheEngine {
|
||||||
protected function _setOptions() {
|
protected function _setOptions() {
|
||||||
$this->_Memcached->setOption(Memcached::OPT_LIBKETAMA_COMPATIBLE, true);
|
$this->_Memcached->setOption(Memcached::OPT_LIBKETAMA_COMPATIBLE, true);
|
||||||
|
|
||||||
if (!array_key_exists($this->settings['serialize'], self::$serializer)) {
|
if (!isset($this->_serializers[$this->settings['serialize']])) {
|
||||||
throw new CacheException(
|
throw new CacheException(
|
||||||
__d('cake_dev', '%s is not a valid serializer engine for Memcached', $this->settings['serialize'])
|
__d('cake_dev', '%s is not a valid serializer engine for Memcached', $this->settings['serialize'])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$serializer = self::$serializer['php'];
|
$serializer = $this->_serializers['php'];
|
||||||
switch($this->settings['serialize']) {
|
switch($this->settings['serialize']) {
|
||||||
case 'igbinary':
|
case 'igbinary':
|
||||||
if (Memcached::HAVE_IGBINARY) {
|
if (Memcached::HAVE_IGBINARY) {
|
||||||
$serializer = self::$serializer['igbinary'];
|
$serializer = $this->_serializers['igbinary'];
|
||||||
} else {
|
} else {
|
||||||
throw new CacheException(
|
throw new CacheException(
|
||||||
__d('cake_dev', 'Memcached extension is not compiled with igbinary support')
|
__d('cake_dev', 'Memcached extension is not compiled with igbinary support')
|
||||||
|
@ -154,7 +154,7 @@ class MemcachedEngine extends CacheEngine {
|
||||||
break;
|
break;
|
||||||
case 'json':
|
case 'json':
|
||||||
if (Memcached::HAVE_JSON) {
|
if (Memcached::HAVE_JSON) {
|
||||||
$serializer = self::$serializer['json'];
|
$serializer = $this->_serializers['json'];
|
||||||
} else {
|
} else {
|
||||||
throw new CacheException(
|
throw new CacheException(
|
||||||
__d('cake_dev', 'Memcached extension is not compiled with json support')
|
__d('cake_dev', 'Memcached extension is not compiled with json support')
|
||||||
|
|
Loading…
Reference in a new issue