Added the possibility to choice an other type cache for a client
This commit is contained in:
@ -23,6 +23,8 @@ use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||
*/
|
||||
class Configuration
|
||||
{
|
||||
private $cacheTypes = array('none', 'disk', 'memory', 'disk_memory');
|
||||
|
||||
/**
|
||||
* Generates the configuration tree.
|
||||
*
|
||||
@ -46,12 +48,13 @@ class Configuration
|
||||
$rootNode
|
||||
->children()
|
||||
->arrayNode('cache')
|
||||
->addDefaultsIfNotSet()
|
||||
->children()
|
||||
->scalarNode('type')
|
||||
->defaultValue('disk')
|
||||
->validate()
|
||||
->ifNotInArray(array('none', 'disk', 'memory', 'disk_memory'))
|
||||
->thenInvalid('The cache type has to be either "none", "disk", "memory" or "disk_memory"')
|
||||
->ifNotInArray($this->cacheTypes)
|
||||
->thenInvalid(sprintf('The cache type has to be either %s', implode(', ', $this->cacheTypes)))
|
||||
->end()
|
||||
->end()
|
||||
->scalarNode('lifetime')->defaultNull()->end()
|
||||
@ -73,6 +76,12 @@ class Configuration
|
||||
->scalarNode('wsdl')
|
||||
->isRequired()
|
||||
->end()
|
||||
->scalarNode('cache_wsdl')
|
||||
->validate()
|
||||
->ifNotInArray($this->cacheTypes)
|
||||
->thenInvalid(sprintf('The cache type has to be either %s', implode(', ', $this->cacheTypes)))
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
|
Reference in New Issue
Block a user