{@inheritdoc}

@see http://symfony.com/doc/current/components/config/definition.html
762701
public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $treeBuilder->root('synapse_cmf')
            ->addDefaultsIfNotSet()
            ->children()
                ->arrayNode('forms')
                    ->canBeEnabled()
                ->end()
                ->arrayNode('media')
                    ->addDefaultsIfNotSet()
                    ->children()
                        ->arrayNode('store')
                            ->addDefaultsIfNotSet()
                            ->children()
                                ->scalarNode('physical_path')
                                    ->cannotBeEmpty()
                                    ->defaultValue('%kernel.root_dir%/../web/assets/')
                                    ->beforeNormalization()
                                        ->ifString()
                                        ->then(function ($v) {
                                            return sprintf('/%s/', trim($v, '/'));
                                        })
                                    ->end()
                                ->end()
                                ->scalarNode('web_path')
                                    ->cannotBeEmpty()
                                    ->defaultValue('assets')
                                    ->beforeNormalization()
                                        ->ifString()
                                        ->then(function ($v) {
                                            return trim($v, '/');
                                        })
                                    ->end()
                                ->end()
                            ->end()
                        ->end()
                    ->end()
                ->end()
                ->arrayNode('components')
                    ->useAttributeAsKey('name')
                    ->prototype('array')
                        ->children()
                            ->scalarNode('controller')
                                ->isRequired()->cannotBeEmpty()
                            ->end()
                            ->scalarNode('template_path')
                                ->isRequired()->cannotBeEmpty()
                            ->end()
                            ->scalarNode('form')
                                ->isRequired()->cannotBeEmpty()
                            ->end()
                            ->arrayNode('config')
                                ->useAttributeAsKey('name')
                                ->prototype('scalar')->end()
                            ->end()
                        ->end()
                    ->end()
                ->end()
                ->arrayNode('content_types')
                    ->useAttributeAsKey('name')
                    ->prototype('array')
                        ->children()
                            ->scalarNode('alias')
                                ->isRequired()->cannotBeEmpty()
                            ->end()
                            ->scalarNode('provider')
                                ->isRequired()->cannotBeEmpty()
                            ->end()
                        ->end()
                    ->end()
                    ->validate()
                        ->ifTrue(function ($v) {
                            foreach ($v as $class => $data) {
                                if (!class_exists($class, true)
                                    || !is_a($class, ContentInterface::class, true)
                                ) {
                                    return true;
                                }
                            }
                        })
                        ->thenInvalid('Content types have to be Synapse\Cmf\Framework\Theme\Content\Model\ContentInterface objects.')
                    ->end()
                ->end()
            ->end()
        ;

        return $treeBuilder;
    }
237295
public function configure($config)
    {
        foreach ((array)$config as $key => $value) {
            $this->setConfig($key, $value);
        }
    }
1001720
public function configure( Config $config )
    {
        parent::configure($config);

        $this->_field_order    = $this->processMacro($config->getList('field_order', []));
        $this->_delimiter      = $this->processMacro($config->getInteger('delimiter', 0));
        $this->_double_quoted  = $this->processMacro($config->getBoolean('double_quoted', false));
        $this->_eol_code       = $this->processMacro($config->getInteger('eol_code', 0));
    }
1233921
public function asConfig()
	{
		// Remove properties that shouldn't be turned into config arrays
		$properties = get_object_vars($this);
		unset($properties['attributeFilters']);
		unset($properties['bundleGenerator']);
		unset($properties['javascript']);
		unset($properties['rendering']);
		unset($properties['rulesGenerator']);
		unset($properties['registeredVars']);
		unset($properties['templateChecker']);
		unset($properties['templateNormalizer']);
		unset($properties['stylesheet']);

		// Create the config array
		$config    = ConfigHelper::toArray($properties);
		$bitfields = RulesHelper::getBitfields($this->tags, $this->rootRules);

		// Save the root context
		$config['rootContext'] = $bitfields['root'];
		$config['rootContext']['flags'] = $config['rootRules']['flags'];

		// Save the registered vars (including the empty ones)
		$config['registeredVars'] = ConfigHelper::toArray($this->registeredVars, true);

		// Make sure those keys exist even if they're empty
		$config += [
			'plugins' => [],
			'tags'    => []
		];

		// Remove unused tags
		$config['tags'] = array_intersect_key($config['tags'], $bitfields['tags']);

		// Add the bitfield information to each tag
		foreach ($bitfields['tags'] as $tagName => $tagBitfields)
		{
			$config['tags'][$tagName] += $tagBitfields;
		}

		// Remove unused entries
		unset($config['rootRules']);

		return $config;
	}
690102
protected function configuration_definition() {
        $form = $this->_form;

        $form->addElement('text', 'path', get_string('path', 'cachestore_file'));
        $form->setType('path', PARAM_SAFEPATH);
        $form->addHelpButton('path', 'path', 'cachestore_file');

        $form->addElement('checkbox', 'autocreate', get_string('autocreate', 'cachestore_file'));
        $form->setType('autocreate', PARAM_BOOL);
        $form->addHelpButton('autocreate', 'autocreate', 'cachestore_file');
        $form->disabledIf('autocreate', 'path', 'eq', '');

        $form->addElement('checkbox', 'singledirectory', get_string('singledirectory', 'cachestore_file'));
        $form->setType('singledirectory', PARAM_BOOL);
        $form->addHelpButton('singledirectory', 'singledirectory', 'cachestore_file');

        $form->addElement('checkbox', 'prescan', get_string('prescan', 'cachestore_file'));
        $form->setType('prescan', PARAM_BOOL);
        $form->addHelpButton('prescan', 'prescan', 'cachestore_file');
    }
1262246
public function get($key)
    {
        if (null === $this->configs) {
            $this->loadConfigs();
        }

        if (false == array_key_exists($key, $this->configs)) {
            $availableKeys = implode(', ', array_keys($this->configs));
            throw new \RuntimeException(sprintf('Config "%s" could not be found. Found: %s', $key, $availableKeys));
        }

        $config = $this->configs[$key];

        if (!$config->getValue() instanceof \stdClass || !isset($config->getValue()->Value)) {
            new \Exception(sprintf('Config "%s" should be stored as \stdClass with a Value property', $key));
        }

        return ($config->getValue() instanceof \stdClass) ? $config->getValue()->Value : $config->getValue();
    }
391541
public static function loadConfig($config = null)
    {
        if ($config !== null) {
            Configure::write('CakeResque', $config);
        }

        if (
            ($hasCheck = method_exists('Configure', 'check')) && !Configure::check('CakeResque') ||
            !$hasCheck && !self::checkConfig('CakeResque')
        ) {
            Configure::load('CakeResque.config');
        }
    }
957343
public function configure(array $config, ConfigurationInterface $configuration, ContainerBuilder $container)
    {
        $processor = new Processor();
        $config    = $processor->processConfiguration($configuration, $config);

        $loader = new XmlFileLoader($container, new FileLocator($this->getConfigurationDirectory()));

		foreach(WallPosterBundle::getAvailableProviders() as $service)
		{
			if(isset($config[$service]))
			{
				$this->mapParameters($service, $config[$service], $container);
				$this->loadConfigurationFile($service,$loader);
			}
		}

        return array($config, $loader);
    }
23368
public function getConfigToManipulate() : Config
    {
        if (!$this->isExtending()) {
            // make sure the force option is set if the configuration file exists
            $this->ensureForce();
            // create a blank configuration to overwrite the old one
            return new Config($this->config->getPath());
        }
        return $this->config;
    }
1101803
protected function instantiateConfig($config = null)
    {
        if (is_null($this->config) || ! is_null($config)) {
            $this->config = ! is_null($config)
                ? $config
                : new Config($this->helper);
        }

        return $this->config;
    }
183812
function (config) {
        config = config || {};
        this.api_key = config.api_key;
        this.host = config.host || undefined;
        this.api_version = config.api_version || undefined;
        this.dev_mode = config.dev_mode || false;
        return this;
    }
154357
protected function configuration_definition() {
        global $OUTPUT;
        $form = $this->_form;

        if (!version_compare(phpversion('mongodb'), '1.5', 'ge')) {
            $form->addElement('html', $OUTPUT->notification(get_string('pleaseupgrademongo', 'cachestore_mongodb')));
        }

        $form->addElement('text', 'server', get_string('server', 'cachestore_mongodb'), array('size' => 72));
        $form->addHelpButton('server', 'server', 'cachestore_mongodb');
        $form->addRule('server', get_string('required'), 'required');
        $form->setDefault('server', 'mongodb://127.0.0.1:27017');
        $form->setType('server', PARAM_RAW);

        $form->addElement('text', 'database', get_string('database', 'cachestore_mongodb'));
        $form->addHelpButton('database', 'database', 'cachestore_mongodb');
        $form->addRule('database', get_string('required'), 'required');
        $form->setType('database', PARAM_ALPHANUMEXT);
        $form->setDefault('database', 'mcache');

        $form->addElement('text', 'username', get_string('username', 'cachestore_mongodb'));
        $form->addHelpButton('username', 'username', 'cachestore_mongodb');
        $form->setType('username', PARAM_ALPHANUMEXT);

        $form->addElement('passwordunmask', 'password', get_string('password', 'cachestore_mongodb'));
        $form->addHelpButton('password', 'password', 'cachestore_mongodb');
        $form->setType('password', PARAM_TEXT);

        $form->addElement('text', 'replicaset', get_string('replicaset', 'cachestore_mongodb'));
        $form->addHelpButton('replicaset', 'replicaset', 'cachestore_mongodb');
        $form->setType('replicaset', PARAM_ALPHANUMEXT);
        $form->setAdvanced('replicaset');

        $form->addElement('checkbox', 'usesafe', get_string('usesafe', 'cachestore_mongodb'));
        $form->addHelpButton('usesafe', 'usesafe', 'cachestore_mongodb');
        $form->setDefault('usesafe', 1);
        $form->setAdvanced('usesafe');
        $form->setType('usesafe', PARAM_BOOL);

        $form->addElement('text', 'usesafevalue', get_string('usesafevalue', 'cachestore_mongodb'));
        $form->addHelpButton('usesafevalue', 'usesafevalue', 'cachestore_mongodb');
        $form->disabledIf('usesafevalue', 'usesafe', 'notchecked');
        $form->setType('usesafevalue', PARAM_INT);
        $form->setAdvanced('usesafevalue');

        $form->addElement('checkbox', 'extendedmode', get_string('extendedmode', 'cachestore_mongodb'));
        $form->addHelpButton('extendedmode', 'extendedmode', 'cachestore_mongodb');
        $form->setDefault('extendedmode', 0);
        $form->setAdvanced('extendedmode');
        $form->setType('extendedmode', PARAM_BOOL);
    }
1007482
public function listGetConfig($definition = null)
    {
        if (!$definition) {
            $definition = $this->primaryDefinition;
        }

        if (!$config = array_get($this->listConfig, $definition)) {
            $config = $this->listConfig[$definition] = $this->makeConfig($this->listDefinitions[$definition], $this->requiredConfig);
        }

        return $config;
    }
122062
public function setConfig($config) {
        $this->config = self::configArrayMergeRecursive($this->config, $config);
        $this->invalidateResponse();
        return $this->config;
    }
1278087
public function initConfiguration(Configuration $configuration = null)
    {
        parent::initConfiguration($configuration);
        if (isset($this->configuration)) {
            $this->twig = $this->configuration->getTwig();
            $this->resolver = $this->configuration->getResolver();
        }
    }
18290
public function load(array $configs, ContainerBuilder $container)
    {
        $configs[] = $this->options;
        $configuration = $this->getConfiguration($configs, $container);
        $config = $this->processConfiguration($configuration, $configs);

        $container->register('templating', 'Symfony\Component\Templating\DelegatingEngine');
        $container->register('templating.template_name_parser', 'Symfony\Component\Templating\TemplateNameParser');

        if (true === $config['enable_php_engine']) {
            $container->setParameter('php.template_dir', $config['template_dir']);

            $container->register('templating.engine.php.loader', 'Symfony\Component\Templating\Loader\FilesystemLoader')
                ->setPublic(false)
                ->addArgument('%php.template_dir%/%%name%%');
            $container->register('templating.engine.php.helper.slots', 'Symfony\Component\Templating\Helper\SlotsHelper');
            $container->register('templating.engine.php.helper.assets', 'Nice\Templating\Helper\AssetsHelper')
                ->addArgument(new Reference('service_container'));
            $container->register('templating.engine.php.helper.router', 'Nice\Templating\Helper\RouterHelper')
                ->addArgument(new Reference('service_container'));
            $container->register('templating.engine.php', 'Symfony\Component\Templating\PhpEngine')
                ->addArgument(new Reference('templating.template_name_parser'))
                ->addArgument(new Reference('templating.engine.php.loader'))
                ->addMethodCall('set', array(new Reference('templating.engine.php.helper.slots')))
                ->addMethodCall('set', array(new Reference('templating.engine.php.helper.assets')))
                ->addMethodCall('set', array(new Reference('templating.engine.php.helper.router')))
                ->addTag('templating.engine');
        }
    }
1147693
public static function configure($config = [])
    {
        if (empty(static::$config)) {
            static::$config = $config;
        }

        if (!in_array($config['driver'], ["smtp", "mail"])) {
            throw new MailException("The type is not known.", E_USER_ERROR);
        }

        if ($config['driver'] == "mail") {
            if (!static::$instance instanceof Native) {
                static::$instance = new Native($config['mail']);
            }
        } else {
            if (!static::$instance instanceof Smtp) {
                static::$instance = new Smtp($config['smtp']);
            }
        }

        return static::$instance;
    }