Added support to redis, wincache and zend data cache.
This commit is contained in:
parent
dd9afddfd9
commit
493aa12f99
@ -331,9 +331,24 @@ abstract class AbstractDoctrineExtension extends Extension
|
|||||||
$container->setDefinition($this->getObjectManagerElementName(sprintf('%s_memcached_instance', $objectManager['name'])), $memcachedInstance);
|
$container->setDefinition($this->getObjectManagerElementName(sprintf('%s_memcached_instance', $objectManager['name'])), $memcachedInstance);
|
||||||
$cacheDef->addMethodCall('setMemcached', array(new Reference($this->getObjectManagerElementName(sprintf('%s_memcached_instance', $objectManager['name'])))));
|
$cacheDef->addMethodCall('setMemcached', array(new Reference($this->getObjectManagerElementName(sprintf('%s_memcached_instance', $objectManager['name'])))));
|
||||||
break;
|
break;
|
||||||
|
case 'redis':
|
||||||
|
$redisClass = !empty($cacheDriver['class']) ? $cacheDriver['class'] : '%'.$this->getObjectManagerElementName('cache.redis.class').'%';
|
||||||
|
$redisInstanceClass = !empty($cacheDriver['instance_class']) ? $cacheDriver['instance_class'] : '%'.$this->getObjectManagerElementName('cache.redis_instance.class').'%';
|
||||||
|
$redisHost = !empty($cacheDriver['host']) ? $cacheDriver['host'] : '%'.$this->getObjectManagerElementName('cache.redis_host').'%';
|
||||||
|
$redisPort = !empty($cacheDriver['port']) ? $cacheDriver['port'] : '%'.$this->getObjectManagerElementName('cache.redis_port').'%';
|
||||||
|
$cacheDef = new Definition($redisClass);
|
||||||
|
$redisInstance = new Definition($redisInstanceClass);
|
||||||
|
$redisInstance->addMethodCall('connect', array(
|
||||||
|
$redisHost, $redisPort
|
||||||
|
));
|
||||||
|
$container->setDefinition($this->getObjectManagerElementName(sprintf('%s_redis_instance', $objectManager['name'])), $redisInstance);
|
||||||
|
$cacheDef->addMethodCall('setRedis', array(new Reference($this->getObjectManagerElementName(sprintf('%s_redis_instance', $objectManager['name'])))));
|
||||||
|
break;
|
||||||
case 'apc':
|
case 'apc':
|
||||||
case 'array':
|
case 'array':
|
||||||
case 'xcache':
|
case 'xcache':
|
||||||
|
case 'wincache':
|
||||||
|
case 'zenddata':
|
||||||
$cacheDef = new Definition('%'.$this->getObjectManagerElementName(sprintf('cache.%s.class', $cacheDriver['type'])).'%');
|
$cacheDef = new Definition('%'.$this->getObjectManagerElementName(sprintf('cache.%s.class', $cacheDriver['type'])).'%');
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
Reference in New Issue
Block a user