Permalink
Browse files

Add a parameter for the lifetime cache directory

  • Loading branch information...
winzou committed Aug 12, 2011
1 parent f89b250 commit 207f427897310e94f560a709b160f619c0507990
@@ -56,8 +56,9 @@ public function getConfigTree()
->arrayNode('options')
->addDefaultsIfNotSet()
->children()
- ->scalarNode('cache_dir') ->defaultValue('%kernel.cache_dir%/winzou_cache')->end()
- ->scalarNode('default_driver')->defaultValue('lifetimefile') ->end()
+ ->scalarNode('cache_dir_lifetime')->end()
+ ->scalarNode('cache_dir') ->defaultValue('%kernel.cache_dir%/winzou_cache')->end()
+ ->scalarNode('default_driver') ->defaultValue('lifetimefile') ->end()
->end()
->end()
->end();
@@ -53,6 +53,10 @@ public function load(array $configs, ContainerBuilder $container)
}
$config['internal']['default_driver_class'] = $config['driver'][$config['options']['default_driver']];
+ // If the lifetime cache directory is not defined, we set it
+ $config['options']['cache_dir_lifetime'] = $config['options']['cache_dir'].DIRECTORY_SEPARATOR.'lifetime';
+
+ // Set the parameters
$this->bindParameter($container, 'winzou_cache', $config);
$loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
@@ -26,7 +26,7 @@ services:
winzou_cache.lifetimefile:
class: %winzou_cache.driver.lifetimefile%
arguments:
- - {'cache_dir': %winzou_cache.options.cache_dir%}
+ - {'cache_dir': %winzou_cache.options.cache_dir_lifetime%}
winzou_cache.memcache:
class: %winzou_cache.driver.memcache%

0 comments on commit 207f427

Please sign in to comment.