Esempio n. 1
0
 public function addConfiguration(NodeBuilder $node)
 {
     $node->scalarNode('provider')->end()->booleanNode('remember_me')->defaultTrue()->end()->scalarNode('success_handler')->end()->scalarNode('failure_handler')->end();
     foreach ($this->options as $name => $default) {
         if (is_bool($default)) {
             $node->booleanNode($name)->defaultValue($default);
         } else {
             $node->scalarNode($name)->defaultValue($default);
         }
     }
 }
Esempio n. 2
0
 public function addConfiguration(NodeBuilder $node)
 {
     $node->scalarNode('key')->isRequired()->cannotBeEmpty()->end()->scalarNode('token_provider')->end();
     foreach ($this->options as $name => $value) {
         if (is_bool($value)) {
             $node->booleanNode($name)->defaultValue($value);
         } else {
             $node->scalarNode($name)->defaultValue($value);
         }
     }
 }
Esempio n. 3
0
 public function addConfiguration(NodeBuilder $builder)
 {
     $builder
         ->scalarNode('provider')->end()
         ->scalarNode('realm')->defaultValue('Secured Area')->end()
     ;
 }
Esempio n. 4
0
 /**
  * @param NodeBuilder $nodeBuilder
  *
  * @return $this
  */
 private function addOptions(NodeBuilder $nodeBuilder)
 {
     // @formatter:off
     /** @noinspection PhpUndefinedMethodInspection */
     $nodeBuilder->scalarNode('use_revisions')->defaultTrue()->end()->scalarNode('base_host')->isRequired()->end()->scalarNode('base_path')->isRequired()->end();
     // @formatter:on
     return $this;
 }
Esempio n. 5
0
 public function addConfiguration(NodeBuilder $builder)
 {
     $builder
         ->scalarNode('provider')->end()
         ->scalarNode('user')->defaultValue('SSL_CLIENT_S_DN_Email')->end()
         ->scalarNode('credentials')->defaultValue('SSL_CLIENT_S_DN')->end()
     ;
 }
 /**
  * @param \Symfony\Component\Config\Definition\Builder\NodeBuilder $nodeBuilder
  */
 protected function defineGrammar(NodeBuilder $nodeBuilder)
 {
     $nodeBuilder->scalarNode('framework')->end()->arrayNode('test_targets')->addDefaultsIfNotSet()->children()->arrayNode('resources')->defaultValue(array(ApplicationContext::getInstance()->getEnvironment()->getWorkingDirectoryAtStartup()))->validate()->ifTrue(function ($v) {
         return count($v) == 0;
     })->then(function ($v) {
         return array(ApplicationContext::getInstance()->getEnvironment()->getWorkingDirectoryAtStartup());
     })->end()->prototype('scalar')->cannotBeEmpty()->end()->end()->booleanNode('recursive')->defaultFalse()->end()->arrayNode('methods')->defaultValue(array())->prototype('scalar')->cannotBeEmpty()->end()->end()->arrayNode('classes')->defaultValue(array())->prototype('scalar')->cannotBeEmpty()->end()->end()->scalarNode('file_pattern')->defaultNull()->cannotBeEmpty()->end()->end()->end()->arrayNode('autotest')->addDefaultsIfNotSet()->treatNullLike(array('enabled' => true))->treatTrueLike(array('enabled' => true))->treatFalseLike(array('enabled' => false))->children()->booleanNode('enabled')->defaultFalse()->end()->arrayNode('watch_dirs')->defaultValue(array())->prototype('scalar')->cannotBeEmpty()->end()->end()->end()->end()->booleanNode('notify')->defaultFalse()->end()->arrayNode('junit_xml')->addDefaultsIfNotSet()->beforeNormalization()->ifString()->then(function ($v) {
         return array('file' => $v);
     })->end()->children()->scalarNode('file')->defaultNull()->cannotBeEmpty()->end()->booleanNode('realtime')->defaultFalse()->end()->end()->end()->booleanNode('stop_on_failure')->defaultFalse()->end()->booleanNode('detailed_progress')->defaultFalse()->end();
 }
 private function addCommonSettings( NodeBuilder $nodeBuilder )
 {
     $nodeBuilder
         ->scalarNode( 'default_provider' )
             ->info( 'Comments provider you want to use by default (e.g. "disqus").' )
         ->end()
         ->arrayNode( 'content_comments' )
             ->info( 'Rules for comments on Content objects. If none provided, commenting will be allowed for any type of content.' )
             ->example(
                 array(
                     'public_articles' => array(
                         'enabled' => true,
                         'provider' => 'facebook',
                         'match' => array(
                             'Identifier\\ContentType' => array( 'article', 'blog_post' ),
                             'Identifier\\Section' => 'standard',
                         )
                     ),
                     'private_articles' => array(
                         'enabled' => true,
                         'provider' => 'disqus',
                         'match' => array(
                             'Identifier\\ContentType' => array( 'article', 'blog_post' ),
                             'Identifier\\Section' => 'private',
                         )
                     )
                 )
             )
             ->useAttributeAsKey( "my_comment_ruleset" )
             ->prototype( "array" )
                 ->normalizeKeys( false )
                 ->children()
                     ->booleanNode( "enabled" )->info( "Indicates if comments are enabled or not. Default is true" )->end()
                     ->scalarNode( "provider" )->info( "Provider to use. Default is configured default_provider" )->end()
                     ->arrayNode( "options" )
                         ->info( 'Provider specific options. See available options for your provider.' )
                         ->prototype( 'variable' )->end()
                     ->end()
                     ->arrayNode( "match" )
                         ->info( 'Condition matchers configuration. You can use the same matchers as for selecting content view templates.' )
                         ->example( array( 'Identifier\\Contentype' => array( 'article', 'blog_post' ) ) )
                         ->useAttributeAsKey( "matcher" )
                         ->prototype( "variable" )->end()
                     ->end()
                 ->end()
             ->end()
         ->end();
 }
 public function buildConfiguration(NodeBuilder $node)
 {
     $node->scalarNode('graph_api_version')->isRequired()->defaultValue('v2.5')->end();
 }
 /**
  * @param \Symfony\Component\Config\Definition\Builder\NodeBuilder $node The node to which to attach the field config to
  * @param array $nestings the nested mappings for the current field level
  */
 protected function addFieldConfig($node, $nestings)
 {
     $node->scalarNode('type')->defaultValue('string')->end()->scalarNode('boost')->end()->scalarNode('store')->end()->scalarNode('index')->end()->scalarNode('index_analyzer')->end()->scalarNode('search_analyzer')->end()->scalarNode('analyzer')->end()->scalarNode('term_vector')->end()->scalarNode('null_value')->end()->booleanNode('include_in_all')->defaultValue(true)->end()->booleanNode('enabled')->defaultValue(true)->end()->scalarNode('lat_lon')->end()->scalarNode('index_name')->end()->booleanNode('omit_norms')->end()->scalarNode('index_options')->end()->scalarNode('ignore_above')->end()->scalarNode('position_offset_gap')->end()->arrayNode('_parent')->treatNullLike(array())->children()->scalarNode('type')->end()->scalarNode('identifier')->defaultValue('id')->end()->end()->end()->scalarNode('format')->end()->scalarNode('similarity')->end();
     if (isset($nestings['fields'])) {
         $this->addNestedFieldConfig($node, $nestings, 'fields');
     }
     if (isset($nestings['properties'])) {
         $this->addNestedFieldConfig($node, $nestings, 'properties');
     }
 }
Esempio n. 10
0
 /**
  * @param NodeBuilder $rootNode
  */
 private function getCoreConfiguration(NodeBuilder $rootNode)
 {
     $rootNode->scalarNode('cache_dir')->defaultValue('%kernel.cache_dir%/sulu')->end();
 }
Esempio n. 11
0
 /**
  * Add the nodes for the "composer-autoload" task.
  *
  * @param NodeBuilder $tasks The node builder.
  *
  * @return void
  *
  * @throws \InvalidArgumentException Will be thrown by the nodes when the input was invalid.
  */
 private function createComposerAutoloadTaskNodes($tasks)
 {
     $tasks->scalarNode('optimize')->info('Optimize the autoloader.')->defaultValue(true)->validate()->always(function ($value) {
         if (!is_bool($value)) {
             throw new \InvalidArgumentException(sprintf('Invalid value %s', json_encode($value)));
         }
         return $value;
     });
 }
 /**
  * @param NodeBuilder $attributeDefinition
  */
 protected function appendResourceDefinition(NodeBuilder $attributeDefinition)
 {
     $attributeDefinition->scalarNode('entity')->isRequired()->end()->scalarNode('filesystem_key')->defaultNull()->end()->scalarNode('endpoint')->defaultNull()->end();
 }
Esempio n. 13
0
 /**
  * Adds semantic configuration definition.
  *
  * @param \Symfony\Component\Config\Definition\Builder\NodeBuilder $nodeBuilder Node just under ezpublish.system.<siteaccess>
  *
  * @return void
  */
 public function addSemanticConfig(NodeBuilder $nodeBuilder)
 {
     $nodeBuilder->scalarNode('repository')->info('The repository to use. Choose among ezpublish.repositories.')->end()->arrayNode('database')->info('DEPRECATED. Use ezpublish.repositories / repository settings instead.')->children()->enumNode('type')->values(array('mysql', 'pgsql', 'sqlite'))->info('The database driver. Can be mysql, pgsql or sqlite.')->end()->scalarNode('server')->end()->scalarNode('port')->end()->scalarNode('user')->cannotBeEmpty()->end()->scalarNode('password')->end()->scalarNode('database_name')->cannotBeEmpty()->end()->scalarNode('charset')->defaultValue('utf8')->end()->scalarNode('socket')->end()->arrayNode('options')->info('Arbitrary options, supported by your DB driver ("driver-opts" in PDO)')->example(array('foo' => 'bar', 'someOptionName' => array('one', 'two', 'three')))->useAttributeAsKey('key')->prototype('variable')->end()->end()->scalarNode('dsn')->info('Full database DSN. Will replace settings above.')->example('mysql://*****:*****@localhost:3306/ezdemo')->end()->end()->end()->scalarNode('cache_pool_name')->example('ez_site_x')->info('The cache pool name to use for a siteaccess / siteaccess-group, *must* be present under stash.caches: yml config. Default value is "default". NB! Setting is Deprecated, will be made redundant in future version.')->end()->scalarNode('var_dir')->cannotBeEmpty()->example('var/ezdemo_site')->info('The directory relative to web/ where files are stored. Default value is "var"')->end()->scalarNode('storage_dir')->cannotBeEmpty()->info("Directory where to place new files for storage, it's relative to var directory. Default value is 'storage'")->end()->scalarNode('binary_dir')->cannotBeEmpty()->info('Directory where binary files (from ezbinaryfile field type) are stored. Default value is "original"')->end()->booleanNode('legacy_mode')->info('Whether to use legacy mode or not. If true, will let the legacy kernel handle url aliases.')->end()->scalarNode('session_name')->info('DEPRECATED. Use session.name instead.')->end()->arrayNode('session')->info('Session options. Will override options defined in Symfony framework.session.*')->children()->scalarNode('name')->info('The session name. If you want a session name per siteaccess, use "{siteaccess_hash}" token. Will override default session name from framework.session.name')->example(array('session' => array('name' => 'eZSESSID{siteaccess_hash}')))->end()->scalarNode('cookie_lifetime')->end()->scalarNode('cookie_path')->end()->scalarNode('cookie_domain')->end()->booleanNode('cookie_secure')->end()->booleanNode('cookie_httponly')->end()->end()->end()->scalarNode('index_page')->info("The page that the index page will show. Default value is null.")->example('/Getting-Started')->end()->scalarNode('default_page')->info('The default page to show, e.g. after user login this will be used for default redirection. If provided, will override "default_target_path" from security.yml.')->example('/Getting-Started')->end()->arrayNode('http_cache')->info('Settings related to Http cache')->cannotBeEmpty()->children()->arrayNode('purge_servers')->info('Servers to use for Http PURGE (will NOT be used if ezpublish.http_cache.purge_type is "local").')->example(array('http://localhost/', 'http://another.server/'))->requiresAtLeastOneElement()->prototype('scalar')->end()->end()->end()->end()->scalarNode('anonymous_user_id')->cannotBeEmpty()->example('10')->info('The ID of the user used for everyone who is not logged in.')->end()->arrayNode('user')->children()->scalarNode('layout')->info('Layout template to use for user related actions. This is most likely the base pagelayout template of your site.')->example(array('layout' => 'eZDemoBundle::pagelayout.html.twig'))->end()->scalarNode('login_template')->info('Template to use for login form. Defaults to EzPublishCoreBundle:security:login.html.twig')->example(array('login_template' => 'AcmeTestBundle:User:login.html.twig'))->end()->end()->end();
 }
Esempio n. 14
0
 public function addConfiguration(NodeBuilder $builder)
 {
     $builder->scalarNode('provider')->end();
 }
 public function buildConfiguration(NodeBuilder $node)
 {
     $node->scalarNode('provider_class')->info('The class name of your provider class (e.g. the one that extends AbstractProvider)')->isRequired()->end()->scalarNode('client_class')->info('If you have a sub-class of OAuth2Client you want to use, add it here')->defaultValue('KnpU\\OAuth2ClientBundle\\Client\\OAuth2Client')->end()->arrayNode('provider_options')->info('Other options to pass to your provider\'s constructor')->prototype('variable')->end()->end();
 }
 /**
  * @param NodeBuilder $familyDefinition
  */
 protected function appendFamilyDefinition(NodeBuilder $familyDefinition)
 {
     $familyDefinition->scalarNode('data_class')->end()->scalarNode('value_class')->end()->scalarNode('label')->defaultNull()->end()->scalarNode('attributeAsLabel')->defaultNull()->end()->scalarNode('attributeAsIdentifier')->defaultNull()->end()->scalarNode('parent')->end()->booleanNode('singleton')->defaultValue(false)->end()->booleanNode('instantiable')->defaultValue(true)->end()->arrayNode('attributes')->prototype('scalar')->end()->end();
 }
Esempio n. 17
0
 /**
  * @param NodeBuilder $nodeBuilder
  * @return NodeBuilder
  */
 public function addWorkflowNodes(NodeBuilder $nodeBuilder)
 {
     $nodeBuilder->scalarNode('name')->cannotBeEmpty()->end()->scalarNode('label')->isRequired()->cannotBeEmpty()->end()->scalarNode('entity')->isRequired()->cannotBeEmpty()->end()->booleanNode('is_system')->defaultFalse()->end()->scalarNode('start_step')->defaultNull()->end()->scalarNode('entity_attribute')->defaultValue(self::DEFAULT_ENTITY_ATTRIBUTE)->end()->booleanNode('steps_display_ordered')->defaultFalse()->end()->append($this->getStepsNode())->append($this->getAttributesNode())->append($this->getTransitionsNode())->append($this->getTransitionDefinitionsNode());
     return $nodeBuilder;
 }
 /**
  * @param \Symfony\Component\Config\Definition\Builder\NodeBuilder $nodeBuilder
  */
 protected function defineGrammar(NodeBuilder $nodeBuilder)
 {
     $nodeBuilder->scalarNode('config')->defaultNull()->cannotBeEmpty()->end();
 }
 public function buildConfiguration(NodeBuilder $node)
 {
     $node->scalarNode('access_type')->defaultValue('online')->end()->scalarNode('hosted_domain')->defaultValue('')->end();
 }
Esempio n. 20
0
 /**
  * @param \Symfony\Component\Config\Definition\Builder\NodeBuilder $node
  */
 private function addApplicationConfiguration(NodeBuilder $node)
 {
     $node->scalarNode('id')->defaultNull()->info('Your Billomat API application’s id')->example('1234');
     $node->scalarNode('secret')->defaultNull()->info('Your Billomat API application’s secret')->example('12345abc67890def12345abc67890def');
 }
 /**
  * @param NodeBuilder $dataGridDefinition
  */
 protected function appendPublisherDefinition(NodeBuilder $dataGridDefinition)
 {
     $dataGridDefinition->scalarNode('entity')->isRequired()->end()->scalarNode('format')->isRequired()->end()->scalarNode('class')->defaultValue(new Parameter('sidus_eav_publishing.publisher.generic'))->end()->scalarNode('serializer')->defaultValue(new Reference('serializer'))->end()->arrayNode('pushers')->prototype('scalar')->end()->end()->variableNode('options')->defaultValue([])->end();
 }
 /**
  * @param NodeBuilder $nodeBuilder
  * @return NodeBuilder
  */
 public function addWorkflowNodes(NodeBuilder $nodeBuilder)
 {
     $nodeBuilder->scalarNode('name')->cannotBeEmpty()->end()->scalarNode('label')->isRequired()->cannotBeEmpty()->end()->enumNode('type')->cannotBeEmpty()->defaultValue(Workflow::TYPE_ENTITY)->values(array(Workflow::TYPE_ENTITY, Workflow::TYPE_WIZARD))->end()->booleanNode('enabled')->defaultTrue()->end()->scalarNode('start_step')->defaultNull()->end()->append($this->getStepsNode())->append($this->getAttributesNode())->append($this->getTransitionsNode())->append($this->getTransitionDefinitionsNode());
     return $nodeBuilder;
 }
 public function buildConfiguration(NodeBuilder $node)
 {
     // todo - add the comments as help text, and render in README
     $node->scalarNode('access_type')->info('Optional value for sending hd parameter. More detail: https://developers.google.com/accounts/docs/OAuth2Login#hd-param')->end()->scalarNode('hosted_domain')->info('Optional value for sending access_type parameter. More detail: https://developers.google.com/identity/protocols/OAuth2WebServer#offline')->end();
 }
Esempio n. 24
0
 private function addTwigOptions(NodeBuilder $rootNode)
 {
     $rootNode->scalarNode('autoescape')->end()->scalarNode('base_template_class')->end()->scalarNode('cache')->addDefaultsIfNotSet()->defaultValue('%kernel.cache_dir%/twig')->end()->scalarNode('charset')->addDefaultsIfNotSet()->defaultValue('%kernel.charset%')->end()->scalarNode('debug')->addDefaultsIfNotSet()->defaultValue('%kernel.debug%')->end()->scalarNode('strict_variables')->end()->scalarNode('auto_reload')->end();
 }
 public function buildConfiguration(NodeBuilder $node)
 {
     // todo - add the comments as help text, and render in README
     $node->scalarNode('access_type')->info('Optional value for sending hd parameter. More detail: https://developers.google.com/accounts/docs/OAuth2Login#hd-param')->end()->scalarNode('hosted_domain')->info('Optional value for sending access_type parameter. More detail: https://developers.google.com/identity/protocols/OAuth2WebServer#offline')->end()->arrayNode('user_fields')->prototype('scalar')->end()->info('Optional value for additional fields to be requested from the user profile. If set, these values will be included with the defaults. More details: https://developers.google.com/+/web/api/rest/latest/people')->end();
 }
Esempio n. 26
0
 /**
  * @param NodeBuilder $nodeBuilder
  */
 private function addCaBundleFileSection(NodeBuilder $nodeBuilder)
 {
     $nodeBuilder->scalarNode('ca_bundle_file');
 }
 /**
  * @param NodeBuilder $fieldDefinition
  */
 protected function appendFieldDefinition(NodeBuilder $fieldDefinition)
 {
     $fieldDefinition->scalarNode('type')->defaultValue('text')->end()->scalarNode('label')->defaultNull()->end()->arrayNode('attributes')->prototype('scalar')->end()->end()->variableNode('options')->defaultNull()->end()->scalarNode('form_type')->defaultValue('text')->end()->variableNode('form_options')->defaultNull()->end();
 }
Esempio n. 28
0
    /**
     * @param NodeBuilder $node
     * @return NodeBuilder
     */
    protected function appendProcessEnvironmentTo(NodeBuilder $node)
    {
        return $node->scalarNode('apparmorLoad')->info(<<<INFO
Load specified AppArmor Mandatory Access Control system profile into the kernel prior to starting the job.
The main job process (as specified by exec or script) will be confined to this profile.
Notes:
 - <profile-path> must be an absolute path.
 - The job will fail if the profile doesn't exist, or the profile fails to load.
INFO
)->validate()->ifNull()->thenUnset()->end()->end()->scalarNode('apparmorSwitch')->info(<<<INFO
Run main job process with already-loaded AppArmor Mandatory Access Control system profile.
Notes:
 - The job will fail if the profile named does not exist, or is not already loaded.
INFO
)->validate()->ifNull()->thenUnset()->end()->end()->arrayNode('cgroup')->info(<<<INFO
Upstart 1.13 supports cgroups with the aid of cgmanager (see cgmanager(8)).
A new "cgroup" stanza is introduced that allows job processes to be run within the specified cgroup.
http://upstart.ubuntu.com/cookbook/#cgroup
INFO
)->example([['cgroup', 'cpu'], ['memory', '$UPSTART_CGROUP', 'limit_in_bytes', 52428800]])->prototype('array')->end()->end()->enumNode('console')->values(['logged', 'output', 'owner', 'none'])->end()->scalarNode('chdir')->info('Runs the job\'s processes with a working directory in the specified directory instead of the root of the filesystem.')->validate()->ifNull()->thenUnset()->end()->end()->scalarNode('chroot')->info('Runs the job\'s processes in a chroot(8) environment underneath the specified directory.')->validate()->ifNull()->thenUnset()->end()->end()->arrayNode('limit')->info('Provides the ability to specify resource limits for a job.')->prototype('array')->children()->enumNode(0)->values(['core', 'cpu', 'data', 'fsize', 'memlock', 'msgqueue', 'nice', 'nofile', 'nproc', 'rss', 'rtprio', 'sigpending', 'stack'])->end()->scalarNode(1)->defaultValue('unlimited')->validate()->always($this->intOrUnlim())->end()->end()->scalarNode(2)->defaultValue('unlimited')->validate()->always($this->intOrUnlim())->end()->end()->end()->end()->end()->scalarNode('nice')->info('Change the jobs scheduling priority from the default. See nice(1).')->validate()->always()->then(function ($v) {
            if (is_null($v)) {
                throw new UnsetKeyException('Unsetting key');
            } elseif (is_int($v) && -20 <= $v && $v <= 19) {
                return $v;
            } else {
                throw new \InvalidArgumentException(sprintf('Value can be -20 <= int <= 19.', json_encode($v)));
            }
        })->end()->end()->scalarNode('oomScore')->info(<<<INFO
Linux has an "Out of Memory" killer facility.
Normally the OOM killer regards all processes equally, this stanza advises the kernel to treat this job differently.
The "adjustment" value provided to this stanza may be an integer value from -999 (very unlikely to be killed by the OOM killer)
up to 1000 (very likely to be killed by the OOM killer).
It may also be the special value never to have the job ignored by the OOM killer entirely
(potentially dangerous unless you really trust the application in all possible system scenarios).
INFO
)->validate()->always()->then(function ($v) {
            if (is_null($v)) {
                throw new UnsetKeyException('Unsetting key');
            } elseif (is_int($v) && -999 <= $v && $v <= 1000) {
                return $v;
            } elseif ($v == 'never') {
                return $v;
            } else {
                throw new \InvalidArgumentException(sprintf('Value can be -999 <= int <= 1000 or "never", but %s was passed.', json_encode($v)));
            }
        })->end()->end()->scalarNode('setgid')->info('Changes to the group before running the job\'s process.')->validate()->ifNull()->thenUnset()->end()->end()->scalarNode('setuid')->info('Changes to the user before running the job\'s process.')->validate()->ifNull()->thenUnset()->end()->end()->scalarNode('umask')->info('Set the file mode creation mask for the process. Value should be an octal value for the mask. See umask(2) for more details.')->validate()->ifNull()->thenUnset()->end()->end();
    }
 public function addSdkNode(NodeBuilder $builder)
 {
     $builder->scalarNode('default_instance')->end()->arrayNode('instances')->requiresAtLeastOneElement()->useAttributeAsKey('name')->prototype('array')->children()->arrayNode('connection')->children()->scalarNode('client_id')->end()->scalarNode('secret')->end()->scalarNode('url')->end()->scalarNode('token')->end()->end()->end()->booleanNode('extended')->defaultTrue()->end()->scalarNode('uploader')->end()->append((new CacheNodeBuilder())->getNode())->append((new MappingNodeBuilder('mappings'))->getNode())->append((new RepositoriesNodeBuilder())->getNode())->append((new SubDefinitionsNodeBuilder('subdefinitions'))->getNode())->append((new SubDefinitionsNodeBuilder('thumbnails'))->getNode())->end()->end()->end();
 }
 public function buildConfiguration(NodeBuilder $node)
 {
     $node->scalarNode('domain')->info('Base installation URL, modify this for self-hosted instances')->defaultValue('https://gitlab.com')->cannotBeEmpty()->end();
 }