DependencyInjection/Configuration.php
private function addMemcacheOptionsSection()
    {
        $tree = new TreeBuilder();
        $node = $tree->root('options');

        // Memcache only configs
        
        $node
            ->addDefaultsIfNotSet()
            ->children()
                ->booleanNode('allow_failover')->defaultTrue()->end()
                ->scalarNode('max_failover_attempts')
		            ->defaultValue(20)
		            ->validate()
		            ->ifTrue(function($v) { return !is_numeric($v); })
		            	->thenInvalid('max_failover_attempts option must be numeric')
		            ->end()
	            ->end()            
                ->scalarNode('default_port')
		            ->defaultValue(11211)
		            ->validate()
		            ->ifTrue(function($v) { return !is_numeric($v); })
		            	->thenInvalid('default_port option must be numeric')
		            ->end()
	            ->end()            
                ->scalarNode('chunk_size')
		            ->defaultValue(32768)
		            ->validate()
		            ->ifTrue(function($v) { return !is_numeric($v); })
		            	->thenInvalid('chunk_size option must be numeric')
		            ->end()
	            ->end()     
                ->scalarNode('protocol')
                    ->defaultValue('ascii')
                    ->validate()
                    ->ifNotInArray(array('ascii', 'binary'))
                        ->thenInvalid('protocol option must be: ascii or binary')
                    ->end()
                ->end()     
                ->scalarNode('hash_strategy')
                    ->defaultValue('consistent')
                    ->validate()
                    ->ifNotInArray(array('standard', 'consistent'))
                        ->thenInvalid('hash_strategy option must be: standard or consistent')
                    ->end()
                ->end()     
                ->scalarNode('hash_function')
                    ->defaultValue('crc32')
                    ->validate()
                    ->ifNotInArray(array('crc32', 'fnv'))
                        ->thenInvalid('hash_function option must be: crc32 or fnv')
                    ->end()
                ->end()            
                ->booleanNode('redundancy')->defaultTrue()->end()            
                ->scalarNode('session_redundancy')
		            ->defaultValue(2)
		            ->validate()
		            ->ifTrue(function($v) { return !is_numeric($v); })
		            	->thenInvalid('session_redundancy option must be numeric')
		            ->end()
	            ->end()             
                ->scalarNode('compress_threshold')
		            ->defaultValue(20000)
		            ->validate()
		            ->ifTrue(function($v) { return !is_numeric($v); })
		            	->thenInvalid('compress_threshold option must be numeric')
		            ->end()
	            ->end()             
                ->scalarNode('lock_timeout')
		            ->defaultValue(15)
		            ->validate()
		            ->ifTrue(function($v) { return !is_numeric($v); })
		            	->thenInvalid('lock_timeout option must be numeric')
		            ->end()
	            ->end() 
            ->end()
        ->end();

        return $node;
    }
private function addMemcacheOptionsSection()
    {
        $tree = new TreeBuilder();
        $node = $tree->root('options');

        // Memcache only configs
        
        $node
            ->addDefaultsIfNotSet()
            ->children()
                ->booleanNode('allow_failover')->defaultTrue()->end()
                ->scalarNode('max_failover_attempts')
		            ->defaultValue(20)
		            ->validate()
		            ->ifTrue(function($v) { return !is_numeric($v); })
		            	->thenInvalid('max_failover_attempts option must be numeric')
		            ->end()
	            ->end()            
                ->scalarNode('default_port')
		            ->defaultValue(11211)
		            ->validate()
		            ->ifTrue(function($v) { return !is_numeric($v); })
		            	->thenInvalid('default_port option must be numeric')
		            ->end()
	            ->end()            
                ->scalarNode('chunk_size')
		            ->defaultValue(32768)
		            ->validate()
		            ->ifTrue(function($v) { return !is_numeric($v); })
		            	->thenInvalid('chunk_size option must be numeric')
		            ->end()
	            ->end()     
                ->scalarNode('protocol')
                    ->defaultValue('ascii')
                    ->validate()
                    ->ifNotInArray(array('ascii', 'binary'))
                        ->thenInvalid('protocol option must be: ascii or binary')
                    ->end()
                ->end()     
                ->scalarNode('hash_strategy')
                    ->defaultValue('consistent')
                    ->validate()
                    ->ifNotInArray(array('standard', 'consistent'))
                        ->thenInvalid('hash_strategy option must be: standard or consistent')
                    ->end()
                ->end()     
                ->scalarNode('hash_function')
                    ->defaultValue('crc32')
                    ->validate()
                    ->ifNotInArray(array('crc32', 'fnv'))
                        ->thenInvalid('hash_function option must be: crc32 or fnv')
                    ->end()
                ->end()            
                ->booleanNode('redundancy')->defaultTrue()->end()            
                ->scalarNode('session_redundancy')
		            ->defaultValue(2)
		            ->validate()
		            ->ifTrue(function($v) { return !is_numeric($v); })
		            	->thenInvalid('session_redundancy option must be numeric')
		            ->end()
	            ->end()             
                ->scalarNode('compress_threshold')
		            ->defaultValue(20000)
		            ->validate()
		            ->ifTrue(function($v) { return !is_numeric($v); })
		            	->thenInvalid('compress_threshold option must be numeric')
		            ->end()
	            ->end()             
                ->scalarNode('lock_timeout')
		            ->defaultValue(15)
		            ->validate()
		            ->ifTrue(function($v) { return !is_numeric($v); })
		            	->thenInvalid('lock_timeout option must be numeric')
		            ->end()
	            ->end() 
            ->end()
        ->end();

        return $node;
    }
private function addMemcacheOptionsSection ( ) { $ tree = new TreeBuilder ( ) ; $ node = $ tree -> root ( 'options' ) ; // Memcache only configs $ node -> addDefaultsIfNotSet ( ) -> children ( ) -> booleanNode ( 'allow_failover' ) -> defaultTrue ( ) -> end ( ) -> scalarNode ( 'max_failover_attempts' ) -> defaultValue ( 20 ) -> validate ( ) -> ifTrue ( function ( $ v ) { return ! is_numeric ( $ v ) ; } ) -> thenInvalid ( 'max_failover_attempts option must be numeric' ) -> end ( ) -> end ( ) -> scalarNode ( 'default_port' ) -> defaultValue ( 11211 ) -> validate ( ) -> ifTrue ( function ( $ v ) { return ! is_numeric ( $ v ) ; } ) -> thenInvalid ( 'default_port option must be numeric' ) -> end ( ) -> end ( ) -> scalarNode ( 'chunk_size' ) -> defaultValue ( 32768 ) -> validate ( ) -> ifTrue ( function ( $ v ) { return ! is_numeric ( $ v ) ; } ) -> thenInvalid ( 'chunk_size option must be numeric' ) -> end ( ) -> end ( ) -> scalarNode ( 'protocol' ) -> defaultValue ( 'ascii' ) -> validate ( ) -> ifNotInArray ( array ( 'ascii' , 'binary' ) ) -> thenInvalid ( 'protocol option must be: ascii or binary' ) -> end ( ) -> end ( ) -> scalarNode ( 'hash_strategy' ) -> defaultValue ( 'consistent' ) -> validate ( ) -> ifNotInArray ( array ( 'standard' , 'consistent' ) ) -> thenInvalid ( 'hash_strategy option must be: standard or consistent' ) -> end ( ) -> end ( ) -> scalarNode ( 'hash_function' ) -> defaultValue ( 'crc32' ) -> validate ( ) -> ifNotInArray ( array ( 'crc32' , 'fnv' ) ) -> thenInvalid ( 'hash_function option must be: crc32 or fnv' ) -> end ( ) -> end ( ) -> booleanNode ( 'redundancy' ) -> defaultTrue ( ) -> end ( ) -> scalarNode ( 'session_redundancy' ) -> defaultValue ( 2 ) -> validate ( ) -> ifTrue ( function ( $ v ) { return ! is_numeric ( $ v ) ; } ) -> thenInvalid ( 'session_redundancy option must be numeric' ) -> end ( ) -> end ( ) -> scalarNode ( 'compress_threshold' ) -> defaultValue ( 20000 ) -> validate ( ) -> ifTrue ( function ( $ v ) { return ! is_numeric ( $ v ) ; } ) -> thenInvalid ( 'compress_threshold option must be numeric' ) -> end ( ) -> end ( ) -> scalarNode ( 'lock_timeout' ) -> defaultValue ( 15 ) -> validate ( ) -> ifTrue ( function ( $ v ) { return ! is_numeric ( $ v ) ; } ) -> thenInvalid ( 'lock_timeout option must be numeric' ) -> end ( ) -> end ( ) -> end ( ) -> end ( ) ; return $ node ; }
Configure the "lsw_memcache.options" section

@return ArrayNodeDefinition
Configure the lsw_memcache . options section