本文整理汇总了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();
}
示例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();
}