Skip to content

Commit

Permalink
Fixed undefined constant
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsteinsland committed Nov 19, 2013
1 parent 7056ccd commit 881f81d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/Cake/Cache/Engine/MemcachedEngine.php
Expand Up @@ -60,7 +60,6 @@ class MemcachedEngine extends CacheEngine {
protected $_serializers = array(
'igbinary' => Memcached::SERIALIZER_IGBINARY,
'json' => Memcached::SERIALIZER_JSON,
'msgpack' => Memcached::SERIALIZER_MSGPACK,
'php' => Memcached::SERIALIZER_PHP
);

Expand All @@ -81,6 +80,11 @@ public function init($settings = array()) {
if (!isset($settings['prefix'])) {
$settings['prefix'] = Inflector::slug(APP_DIR) . '_';
}

if (defined('Memcached::HAVE_MSGPACK') && Memcached::HAVE_MSGPACK) {
$this->_serializers['msgpack'] = Memcached::SERIALIZER_MSGPACK;
}

$settings += array(
'engine' => 'Memcached',
'servers' => array('127.0.0.1'),
Expand Down

0 comments on commit 881f81d

Please sign in to comment.