当前位置: 首页>>代码示例>>PHP>>正文


PHP NodeBuilder::enumNode方法代码示例

本文整理汇总了PHP中Symfony\Component\Config\Definition\Builder\NodeBuilder::enumNode方法的典型用法代码示例。如果您正苦于以下问题:PHP NodeBuilder::enumNode方法的具体用法?PHP NodeBuilder::enumNode怎么用?PHP NodeBuilder::enumNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Symfony\Component\Config\Definition\Builder\NodeBuilder的用法示例。


在下文中一共展示了NodeBuilder::enumNode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: appendProcessControlTo

    /**
     * @param NodeBuilder $node
     * @return NodeBuilder
     */
    protected function appendProcessControlTo(NodeBuilder $node)
    {
        return $node->enumNode('expect')->info(<<<INFO
fork - Upstart will expect the process executed to call fork(2) exactly once.
daemon - Upstart will expect the process executed to call fork(2) exactly twice.
stop  - Specifies that the job's main process will raise the SIGSTOP signal to indicate that it is ready.
init(8) will wait for this signal and then:
 - Immediately send the process SIGCONT to allow it to continue.
 - Run the job's post-start script (if any).
Only then will Upstart consider the job to be running.
INFO
)->values(['fork', 'deamon', 'stop'])->validate()->ifNull()->thenUnset()->end()->end()->enumNode('killSignal')->info('Specifies the stopping signal, SIGTERM by default, a job\'s main process will receive when stopping the running job.')->values(['SIGHUP', 'SIGINT', 'SIGQUIT', 'SIGILL', 'SIGTRAP', 'SIGIOT', 'SIGBUS', 'SIGFPE', 'SIGKILL', 'SIGUSR1', 'SIGSEGV', 'SIGUSR2', 'SIGPIPE', 'SIGALRM', 'SIGTERM', 'SIGSTKFLT', 'SIGCHLD', 'SIGCONT', 'SIGSTOP', 'SIGTSTP', 'SIGTTIN', 'SIGTTOU', 'SIGURG', 'SIGXCPU', 'SIGXFSZ', 'SIGVTALRM', 'SIGPROF', 'SIGWINCH', 'SIGIO', 'SIGPWR'])->end()->integerNode('killTimeout')->info('The number of seconds Upstart will wait before killing a process. The default is 5 seconds.')->min(1)->end()->enumNode('reloadSignal')->info('Specifies the signal that Upstart will send to the jobs main process when the job needs to be reloaded (the default is SIGHUP).')->values(['SIGHUP', 'SIGINT', 'SIGQUIT', 'SIGILL', 'SIGTRAP', 'SIGIOT', 'SIGBUS', 'SIGFPE', 'SIGKILL', 'SIGUSR1', 'SIGSEGV', 'SIGUSR2', 'SIGPIPE', 'SIGALRM', 'SIGTERM', 'SIGSTKFLT', 'SIGCHLD', 'SIGCONT', 'SIGSTOP', 'SIGTSTP', 'SIGTTIN', 'SIGTTOU', 'SIGURG', 'SIGXCPU', 'SIGXFSZ', 'SIGVTALRM', 'SIGPROF', 'SIGWINCH', 'SIGIO', 'SIGPWR'])->end();
    }
开发者ID:tarasbogach,项目名称:UpstartBundle,代码行数:17,代码来源:Configuration.php

示例2: buildConfigNode

 /**
  * @param NodeBuilder $nodeBuilder
  *
  * @return ArrayNodeDefinition
  */
 private function buildConfigNode(NodeBuilder $nodeBuilder)
 {
     return $nodeBuilder->enumNode('serializer')->values([self::SERIALIZER_JSON_ENCODE, self::SERIALIZER_JSON_GROUP_ENCODE, self::SERIALIZER_JMS_SERIALIZER])->end()->arrayNode('serialize_groups')->prototype('scalar')->end()->end()->scalarNode('cors_allow_origin_regex')->end()->arrayNode('cors_allow_headers')->prototype('scalar')->end()->end()->integerNode('cors_max_age')->end();
 }
开发者ID:mattjanssen,项目名称:api-response-bundle,代码行数:9,代码来源:Configuration.php


注:本文中的Symfony\Component\Config\Definition\Builder\NodeBuilder::enumNode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。