Configure the "lsw_memcache.options" section

@return ArrayNodeDefinition
168765
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;
    }
417283
protected function addOptionsNode()
    {
        $builder = new TreeBuilder();
        $node    = $builder->root('options');

        $node
            ->prototype('variable')
            ->end();

        return $node;
    }
69463
public function appendConfiguration(ArrayNodeDefinition $rootNode)
    {
        $rootNode
            ->children()
                ->arrayNode('messages')
                    ->addDefaultsIfNotSet()
                    ->children()
                        ->arrayNode('languages')->performNoDeepMerging()->prototype('scalar')->end()->defaultValue(array('nl', 'en', 'fr'))->end()
                        ->booleanNode('overwrite_compatibility')->defaultTrue()->end()
                        ->scalarNode('yaz_cleanup')->end()
                    ->end()
                ->end()
            ->end()
        ;
    }
71843
protected function setupTree(ArrayNodeDefinition $rootNode)
    {
        $rootNode
            ->addDefaultsIfNotSet()
            ->children()
                ->arrayNode('queues')
                    ->prototype('scalar')->end()
                ->end()
                ->scalarNode('serializer')
                    ->treatNullLike('RSQueue\\Serializer\\JsonSerializer')
                    ->defaultValue('RSQueue\\Serializer\\JsonSerializer')
                ->end()
                ->arrayNode('collector')
                    ->addDefaultsIfNotSet()
                    ->children()
                        ->booleanNode('enable')
                            ->defaultTrue()
                        ->end()
                    ->end()
                ->end()
                ->arrayNode('server')
                    ->addDefaultsIfNotSet()
                    ->children()
                        ->arrayNode('redis')
                            ->addDefaultsIfNotSet()
                            ->children()
                                ->scalarNode('cluster')
                                    ->defaultFalse()
                                ->end()
                                ->scalarNode('host')
                                    ->defaultValue('127.0.0.1')
                                ->end()
                                ->scalarNode('port')
                                    ->defaultValue(6379)
                                ->end()
                                ->scalarNode('database')
                                    ->defaultNull()
                                ->end()
                            ->end()
                        ->end()
                    ->end()
                ->end()
            ->end();
    }
863955
protected function config($cacheKey, $cacheOptions)
    {
        $opts = [];

        if (is_numeric($cacheKey)) {
            if (is_array($cacheOptions)) {
                // Most explicit configuration provided
                $opts = $cacheOptions;
                $relatedModel = array_get($opts, 'model');
            } else {
                // Smallest number of options provided, figure out the rest
                $relatedModel = $cacheOptions;
            }
        } else {
            // Semi-verbose configuration provided
            $relatedModel = $cacheOptions;
            $opts['field'] = $cacheKey;

            if (is_array($cacheOptions)) {
                if (isset($cacheOptions[3])) {
                    $opts['key'] = $cacheOptions[3];
                }
                if (isset($cacheOptions[2])) {
                    $opts['foreignKey'] = $cacheOptions[2];
                }
                if (isset($cacheOptions[1])) {
                    $opts['columnToSum'] = $cacheOptions[1];
                }
                if (isset($cacheOptions[0])) {
                    $relatedModel = $cacheOptions[0];
                }
            }
        }

        return $this->defaults($opts, $relatedModel);
    }
836972
public function setConnection(\Memcached $memcached)
    {
        $this->connection = $memcached;

        if (!count($this->connection->getServerList())) {
            $this->configureServers();
        }

        $this->setOptions();
        return $this;
    }
1009718
public function configure(Memcache $memcache, array $connections)
    {
        foreach ($connections as $conn) {
            $memcache->addServer($conn['host'], $conn['port'], $conn['persistent'], $conn['weight'], $conn['timeout'], $conn['retry_interval']);
        }

        return $memcache;
    }
414725
private function addMemcacheNode()
    {
        $builder = new TreeBuilder('memcache');
        $node    = $this->getRootNode($builder, 'memcache');
        $host    = '%doctrine_cache.memcache.host%';
        $port    = '%doctrine_cache.memcache.port%';

        $node
            ->addDefaultsIfNotSet()
            ->fixXmlConfig('server')
            ->children()
                ->scalarNode('connection_id')->defaultNull()->end()
                ->arrayNode('servers')
                ->useAttributeAsKey('host')
                ->normalizeKeys(false)
                    ->prototype('array')
                        ->beforeNormalization()
                            ->ifTrue(function ($v) {
                                return is_scalar($v);
                            })
                            ->then(function ($val) {
                                return array('port' => $val);
                            })
                        ->end()
                        ->children()
                            ->scalarNode('host')->defaultValue($host)->end()
                            ->scalarNode('port')->defaultValue($port)->end()
                        ->end()
                    ->end()
                    ->defaultValue(array($host => array(
                        'host' => $host,
                        'port' => $port
                    )))
                ->end()
            ->end()
        ;

        return $node;
    }
544120
public static function config_get_serialiser_options() {
        $options = array(
            Memcached::SERIALIZER_PHP => get_string('serialiser_php', 'cachestore_memcached')
        );
        if (Memcached::HAVE_JSON) {
            $options[Memcached::SERIALIZER_JSON] = get_string('serialiser_json', 'cachestore_memcached');
        }
        if (Memcached::HAVE_IGBINARY) {
            $options[Memcached::SERIALIZER_IGBINARY] = get_string('serialiser_igbinary', 'cachestore_memcached');
        }
        return $options;
    }
893844
function MempoolOptions(options) {
  if (!(this instanceof MempoolOptions))
    return new MempoolOptions(options);

  this.network = Network.primary;
  this.chain = null;
  this.logger = null;
  this.workers = null;
  this.fees = null;

  this.limitFree = true;
  this.limitFreeRelay = 15;
  this.relayPriority = true;
  this.requireStandard = this.network.requireStandard;
  this.rejectAbsurdFees = true;
  this.prematureWitness = false;
  this.paranoidChecks = false;
  this.replaceByFee = false;

  this.maxSize = policy.MEMPOOL_MAX_SIZE;
  this.maxOrphans = policy.MEMPOOL_MAX_ORPHANS;
  this.maxAncestors = policy.MEMPOOL_MAX_ANCESTORS;
  this.expiryTime = policy.MEMPOOL_EXPIRY_TIME;
  this.minRelay = this.network.minRelay;

  this.prefix = null;
  this.location = null;
  this.db = 'memory';
  this.maxFiles = 64;
  this.cacheSize = 32 << 20;
  this.compression = true;
  this.bufferKeys = layout.binary;

  this.persistent = false;

  this.fromOptions(options);
}
40262
public static function 
    {

        if (self::$memcached) {
            return;
        }

        self::$memcached = new \Memcached();

        foreach (self::$config['memcached']['servers'] as $server) {
            extract(array_merge(self::$memcachedServerDefaults, $server));

            self::$memcached->addServers($host, $port, $persistent, $weight, $timeout);
        }
    }
950814
private function initializeMemCache()
    {
        $this->memcache = new \Memcache();

        // support multiple hosts using semicolon to separate hosts
        $hosts = explode(';', $this->host);

        // different ports for each hosts the same way
        $ports = explode(';', $this->port);

        if (count($ports) < 1) {
            $ports = array_fill(0, count($hosts), self::DEFAULT_PORT);
        } elseif (count($ports) === 1) {
            // if we have just one port, use it for all hosts
            $usedPort = $ports[0];
            $ports    = array_fill(0, count($hosts), $usedPort);
        }

        foreach ($hosts as $i => $host) {
            if (!isset($ports[$i])) {
                /*
                 * if we have a difference between the count of hosts and
                 * the count of ports, use the default port to fill the gap
                 */
                $ports[$i] = self::DEFAULT_PORT;
            }

            $this->memcache->addServer($host, $ports[$i]);
        }
    }
228388
protected function configure()
    {
        $this->setDescription($this->shortDesc);

        foreach($this->paramsArray as $nameParam => $arrayOptions){
            if($arrayOptions['optional']){
                $this->addOption($nameParam, null, InputOption::VALUE_OPTIONAL, $arrayOptions['comment'], null);
            }
            else {
                $this->addOption($nameParam, null, InputOption::VALUE_REQUIRED, $arrayOptions['comment'], null);
            } 
        }
    }
1215139
protected function configure()
    {
        $this
            ->setName('check')
            ->setDescription('Check PHP files within a directory for appropriate use of Docblocks.')
            ->addOption(
                'exclude',
                'x',
                InputOption::VALUE_REQUIRED,
                'Files and directories to exclude.'
            )
            ->addOption(
                'directory',
                'd',
                InputOption::VALUE_REQUIRED,
                'Directory to scan.',
                './'
            )
            ->addOption(
                'skip-classes',
                null,
                InputOption::VALUE_NONE,
                'Don\'t check classes for docblocks.'
            )
            ->addOption(
                'skip-methods',
                null,
                InputOption::VALUE_NONE,
                'Don\'t check methods for docblocks.'
            )
            ->addOption(
                'skip-signatures',
                null,
                InputOption::VALUE_NONE,
                'Don\'t check docblocks against method signatures.'
            )
            ->addOption(
                'only-signatures',
                null,
                InputOption::VALUE_NONE,
                'Ignore missing docblocks where method doesn\'t have parameters or return type.'
            )
            ->addOption(
                'json',
                'j',
                InputOption::VALUE_NONE,
                'Output JSON instead of a log.'
            )
            ->addOption(
                'files-per-line',
                'l',
                InputOption::VALUE_REQUIRED,
                'Number of files per line in progress',
                50
            )
            ->addOption(
                'fail-on-warnings',
                'w',
                InputOption::VALUE_NONE,
                'Consider the check failed if any warnings are produced.'
            )
            ->addOption(
                'info-only',
                'i',
                InputOption::VALUE_NONE,
                'Information-only mode, just show summary.'
            )
            ->addOption(
                'from-stdin',
                null,
                InputOption::VALUE_NONE,
                'Use list of files from stdin (e.g. git diff)'
            )
            ->addOption(
                'cache-file',
                null,
                InputOption::VALUE_REQUIRED,
                'Cache analysis of files based on filemtime.'
            )
            ->addOption(
                'config-file',
                null,
                InputOption::VALUE_REQUIRED,
                'File to read doccheck config from in yml format'
            );
    }
142743
private function addOptions(ArrayNodeDefinition $node)
    {
        $node
            ->children()
                ->booleanNode('cacheable')
                    ->defaultTrue()
                    ->info('Use cache. More disk reads but less CPU usage. Masks and format templates are stored there.')
                ->end()
            ->end()
            ->children()
                ->scalarNode('cache_dir')
                    ->defaultValue('')
                    ->info('Cache dir')
                    ->example('/var/cache/')
                ->end()
            ->end()
            ->children()
                ->scalarNode('logs_dir')
                    ->defaultValue('')
                    ->info('Logs dir')
                    ->example('/var/logs/')
                ->end()
            ->end()
            ->children()
                ->booleanNode('find_best_mask')
                    ->defaultTrue()
                    ->info('If true, estimates best mask. Set to false to significant performance boost but (probably) worst quality code.')
                ->end()
            ->end()
            ->children()
                ->booleanNode('find_from_random')
                    ->defaultFalse()
                    ->info('If false, checks all masks available.')
                ->end()
            ->end()
            ->children()
                ->scalarNode('default_mask')
                    ->defaultValue('2')
                    ->info('Default mask when find_best_mask is false')
                    ->example('2')
                    ->validate()
                        ->ifTrue(function($v) {
                            return (0 === preg_match('/^[0-9]+$/', $v));
                        })
                        ->thenInvalid('default_mask must be an integer value greater than 0 (default value 2).')
                    ->end()
                ->end()
            ->end()
            ->children()
                ->scalarNode('png_maximum_size')
                    ->defaultValue('1024')
                    ->info('PNG image maximum size')
                    ->example('1024')
                    ->validate()
                        ->ifTrue(function($v) {
                            return (0 === preg_match('/^[0-9]+$/', $v));
                        })
                        ->thenInvalid('png_maximum_size must be an integer value greater than 0 (default value 1024).')
                    ->end()
                ->end()
            ->end()
            ->children()
                ->booleanNode('absolute_url')
                    ->defaultTrue()
                    ->info('Create absolute URLs for the images. If false URLs will be relative.')
                ->end()
            ->end()
            ->children()
                ->scalarNode('http_max_age')
                    ->defaultValue('600')
                    ->info('Max age in seconds for the HTTP cache')
                    ->example('600')
                    ->validate()
                        ->ifTrue(function($v) {
                            return (0 === preg_match('/^[0-9]+$/', $v));
                        })
                        ->thenInvalid('http_max_age must be an integer value greater than 0 (default value 600).')
                    ->end()
                ->end()
            ->end()
            ->children()
                ->scalarNode('https_max_age')
                    ->defaultValue('600')
                    ->info('Max age in seconds for the HTTP cache in shared connections (proxies)')
                    ->example('600')
                    ->validate()
                        ->ifTrue(function($v) {
                            return (0 === preg_match('/^[0-9]+$/', $v));
                        })
                        ->thenInvalid('https_max_age must be an integer value greater than 0 (default value 600).')
                    ->end()
                ->end()
            ->end()
        ;
    }
1037951
public function appendConfiguration(ArrayNodeDefinition $rootNode)
    {
        $rootNode
            ->children()
                ->arrayNode('qa')
                    ->children()
                        ->arrayNode('phpcs')
                        ->children()
                        ->arrayNode('dir')
                        ->prototype('scalar')->end()
                        ->performNoDeepMerging()
                        ->end()
                        ->scalarNode('standard')->end()
                        ->scalarNode('options')->end()
                        ->end()
                        ->end()
                        ->arrayNode('jshint')
                        ->children()
                        ->arrayNode('files')
                        ->beforeNormalization()
                        ->ifString()->then(
                        function($v) {
                            return array_filter(array($v));
                        }
                    )
                        ->end()
                        ->prototype('scalar')->end()
                        ->performNoDeepMerging()
                        ->end()
                        ->scalarNode('run')->end()
                        ->end()
                    ->end()
                ->end()
        ->end();
    }
180369
protected function getConfiguration(): array
    {
        $config = Configuration::getConfiguration();

        return [
            'cacheTagsEnable' => $config['cacheTagsEnable'] ?? false,
            'cacheTagsHeaderName' => isset($config['cacheTagsHeaderName']) && \mb_strlen((string)$config['cacheTagsHeaderName']) ? (string)$config['cacheTagsHeaderName'] : 'X-Cache-Tags',
        ];
    }