Fixed undefined constant

This commit is contained in:
davidsteinsland 2013-11-19 11:50:28 +01:00
parent 7056ccd38a
commit 881f81d01a

View file

@ -60,7 +60,6 @@ class MemcachedEngine extends CacheEngine {
protected $_serializers = array( protected $_serializers = array(
'igbinary' => Memcached::SERIALIZER_IGBINARY, 'igbinary' => Memcached::SERIALIZER_IGBINARY,
'json' => Memcached::SERIALIZER_JSON, 'json' => Memcached::SERIALIZER_JSON,
'msgpack' => Memcached::SERIALIZER_MSGPACK,
'php' => Memcached::SERIALIZER_PHP 'php' => Memcached::SERIALIZER_PHP
); );
@ -81,6 +80,11 @@ class MemcachedEngine extends CacheEngine {
if (!isset($settings['prefix'])) { if (!isset($settings['prefix'])) {
$settings['prefix'] = Inflector::slug(APP_DIR) . '_'; $settings['prefix'] = Inflector::slug(APP_DIR) . '_';
} }
if (defined('Memcached::HAVE_MSGPACK') && Memcached::HAVE_MSGPACK) {
$this->_serializers['msgpack'] = Memcached::SERIALIZER_MSGPACK;
}
$settings += array( $settings += array(
'engine' => 'Memcached', 'engine' => 'Memcached',
'servers' => array('127.0.0.1'), 'servers' => array('127.0.0.1'),