PHP 클래스 Webmozart\Console\Api\Config\ApplicationConfig

부터: 1.0
저자: Bernhard Schussek ([email protected])
상속: extends Config
파일 보기 프로젝트 열기: webmozart/console 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( string $name = null, string $version = null ) Creates a new console application.
addCommandConfig ( CommandConfig $config ) : static Adds a command configuration to the application.
addCommandConfigs ( array $configs ) : static Adds command configurations to the application.
addEventListener ( string $eventName, callable $listener, integer $priority ) : static Adds a listener for the given event name.
addEventSubscriber ( Symfony\Component\EventDispatcher\EventSubscriberInterface $subscriber ) : static Adds an event subscriber to the dispatcher.
addStyle ( Style $style ) : static Adds a style to the style set.
addStyles ( array $styles ) : static Adds multiple styles to the style set.
beginCommand ( string $name ) : CommandConfig Starts a configuration block for a command.
create ( string $name = null, string $version = null ) : static Creates a new console application.
editCommand ( string $name ) : CommandConfig Alias for {@link getCommandConfig()}.
getCommandConfig ( string $name ) : CommandConfig Returns the command configuration for a given name.
getCommandConfigs ( ) : CommandConfig[] Returns all registered command configurations.
getCommandResolver ( ) : Webmozart\Console\Api\Resolver\CommandResolver Returns the used command resolver.
getDisplayName ( ) : string Returns the application name as it is displayed in the help.
getEventDispatcher ( ) : Symfony\Component\EventDispatcher\EventDispatcherInterface Returns the event dispatcher used to dispatch the console events.
getHelp ( ) : string Returns the help text of the application.
getIOFactory ( ) : callable Returns the callable used to create {@link IO} instances.
getName ( ) : string Returns the name of the application.
getStyleSet ( ) : StyleSet Returns the configured style set.
getVersion ( ) : string Returns the version of the application.
hasCommandConfig ( string $name ) : boolean Returns whether the application has a command with a given name.
hasCommandConfigs ( ) : boolean Returns whether the application has any registered command configurations.
isDebug ( ) : boolean Returns whether the application is in debug mode.
isExceptionCaught ( ) : boolean Returns whether the application catches and displays exceptions thrown while running a command.
isTerminatedAfterRun ( ) : boolean Returns whether the PHP process is terminated after running a command.
removeEventListener ( string $eventName, callable $listener ) : static Removes an event listener for the given event name.
removeEventSubscriber ( Symfony\Component\EventDispatcher\EventSubscriberInterface $subscriber ) : static Removes an event subscriber from the dispatcher.
removeStyle ( string $tag ) : static Removes a style from the style set.
setCatchExceptions ( boolean $catch ) : static Sets whether the application catches and displays exceptions thrown while running a command.
setCommandConfigs ( array $configs ) : static Sets the command configurations of the application.
setCommandResolver ( Webmozart\Console\Api\Resolver\CommandResolver $commandResolver ) : static Sets the used command resolver.
setDebug ( boolean $debug ) : static Sets whether the application is in debug mode.
setDisplayName ( string $displayName ) : static Sets the application name as it is displayed in the help.
setEventDispatcher ( Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher = null ) : static Sets the event dispatcher for dispatching the console events.
setHelp ( string $help ) : static Sets the help text of the application.
setIOFactory ( callable $ioFactory ) : static Sets the callable used to create {@link IO} instances.
setName ( string $name ) : static Sets the name of the application.
setStyleSet ( StyleSet $styleSet ) : static Sets the used style set.
setTerminateAfterRun ( boolean $terminate ) : static Sets whether to terminate the PHP process after running a command.
setVersion ( string $version ) : static Sets the version of the application.

보호된 메소드들

메소드 설명
getDefaultDisplayName ( ) : string Returns the default display name used if no display name is set.

메소드 상세

__construct() 공개 메소드

Creates a new console application.
public __construct ( string $name = null, string $version = null )
$name string The name of the application.
$version string The application version.

addCommandConfig() 공개 메소드

Adds a command configuration to the application.
또한 보기: beginCommand()
public addCommandConfig ( CommandConfig $config ) : static
$config CommandConfig The command configuration.
리턴 static The current instance.

addCommandConfigs() 공개 메소드

Adds command configurations to the application.
또한 보기: beginCommand()
public addCommandConfigs ( array $configs ) : static
$configs array The command configurations.
리턴 static The current instance.

addEventListener() 공개 메소드

See {@link ConsoleEvents} for the supported event names.
또한 보기: EventDispatcherInterface::addListener()
public addEventListener ( string $eventName, callable $listener, integer $priority ) : static
$eventName string The event to listen to.
$listener callable The callback to execute when the event is dispatched.
$priority integer The event priority.
리턴 static The current instance.

addEventSubscriber() 공개 메소드

Adds an event subscriber to the dispatcher.
또한 보기: EventDispatcherInterface::addSubscriber()
public addEventSubscriber ( Symfony\Component\EventDispatcher\EventSubscriberInterface $subscriber ) : static
$subscriber Symfony\Component\EventDispatcher\EventSubscriberInterface The subscriber to add.
리턴 static The current instance.

addStyle() 공개 메소드

Adds a style to the style set.
또한 보기: StyleSet::add()
public addStyle ( Style $style ) : static
$style Webmozart\Console\Api\Formatter\Style The style to add.
리턴 static The current instance.

addStyles() 공개 메소드

Adds multiple styles to the style set.
또한 보기: StyleSet::merge()
public addStyles ( array $styles ) : static
$styles array The styles to add.
리턴 static The current instance.

beginCommand() 공개 메소드

The configuration of the command is returned by this method. You can use the fluent interface to configure the sub-command before jumping back to this configuration with {@link CommandConfig::end()}: php protected function configure() { $this ->setName('server') ->setDescription('List and manage servers') ->beginCommand('add') ->setDescription('Add a server') ->addArgument('host', Argument::REQUIRED) ->addOption('port', 'p', Option::VALUE_OPTIONAL, null, 80) ->end() ... ; }
또한 보기: editCommand()
public beginCommand ( string $name ) : CommandConfig
$name string The name of the command.
리턴 CommandConfig The command configuration.

create() 공개 정적인 메소드

Creates a new console application.
public static create ( string $name = null, string $version = null ) : static
$name string The name of the application.
$version string The application version.
리턴 static The created instance.

editCommand() 공개 메소드

This method can be used to nicely edit a command inherited from a parent configuration using the fluent API: php protected function configure() { parent::configure(); $this ->editCommand('add') ... ->end() ... ; }
또한 보기: beginCommand()
public editCommand ( string $name ) : CommandConfig
$name string The name of the command to edit.
리턴 CommandConfig The command configuration.

getCommandConfig() 공개 메소드

Returns the command configuration for a given name.
또한 보기: beginCommand()
public getCommandConfig ( string $name ) : CommandConfig
$name string The name of the command.
리턴 CommandConfig The command configuration.

getCommandConfigs() 공개 메소드

Returns all registered command configurations.
또한 보기: beginCommand()
public getCommandConfigs ( ) : CommandConfig[]
리턴 CommandConfig[] The command configurations.

getCommandResolver() 공개 메소드

Returns the used command resolver.
또한 보기: setCommandResolver()
public getCommandResolver ( ) : Webmozart\Console\Api\Resolver\CommandResolver
리턴 Webmozart\Console\Api\Resolver\CommandResolver The command resolver.

getDefaultDisplayName() 보호된 메소드

Returns the default display name used if no display name is set.
protected getDefaultDisplayName ( ) : string
리턴 string The default display name.

getDisplayName() 공개 메소드

If no display name is set with {@link setDisplayName()}, the humanized application name is returned.
또한 보기: setDisplayName()
public getDisplayName ( ) : string
리턴 string The display name.

getEventDispatcher() 공개 메소드

Returns the event dispatcher used to dispatch the console events.
public getEventDispatcher ( ) : Symfony\Component\EventDispatcher\EventDispatcherInterface
리턴 Symfony\Component\EventDispatcher\EventDispatcherInterface The event dispatcher.

getHelp() 공개 메소드

Returns the help text of the application.
public getHelp ( ) : string
리턴 string The help text.

getIOFactory() 공개 메소드

Returns the callable used to create {@link IO} instances.
또한 보기: setIOFactory()
public getIOFactory ( ) : callable
리턴 callable The callable or `null` if none was set.

getName() 공개 메소드

Returns the name of the application.
또한 보기: setName()
public getName ( ) : string
리턴 string The application name.

getStyleSet() 공개 메소드

Returns the configured style set.
또한 보기: setStyleSet()
public getStyleSet ( ) : StyleSet
리턴 Webmozart\Console\Api\Formatter\StyleSet The style set.

getVersion() 공개 메소드

Returns the version of the application.
public getVersion ( ) : string
리턴 string The application version.

hasCommandConfig() 공개 메소드

Returns whether the application has a command with a given name.
또한 보기: beginCommand()
public hasCommandConfig ( string $name ) : boolean
$name string The name of the command.
리턴 boolean Returns `true` if the command configuration with the given name exists and `false` otherwise.

hasCommandConfigs() 공개 메소드

Returns whether the application has any registered command configurations.
또한 보기: beginCommand()
public hasCommandConfigs ( ) : boolean
리턴 boolean Returns `true` if command configurations were added to the application and `false` otherwise.

isDebug() 공개 메소드

In debug mode, the verbosity is always {@link IO::DEBUG}.
또한 보기: setDebug()
public isDebug ( ) : boolean
리턴 boolean Returns `true` if the application is in debug mode.

isExceptionCaught() 공개 메소드

Returns whether the application catches and displays exceptions thrown while running a command.
또한 보기: setCatchExceptions()
public isExceptionCaught ( ) : boolean
리턴 boolean Returns `true` if exceptions are caught and `false` otherwise.

isTerminatedAfterRun() 공개 메소드

Returns whether the PHP process is terminated after running a command.
또한 보기: setTerminateAfterRun()
public isTerminatedAfterRun ( ) : boolean
리턴 boolean Returns `true` if the PHP process is terminated after {@link run()} and `false` otherwise.

removeEventListener() 공개 메소드

Removes an event listener for the given event name.
또한 보기: EventDispatcherInterface::removeListener()
public removeEventListener ( string $eventName, callable $listener ) : static
$eventName string The event name.
$listener callable The callback to remove.
리턴 static The current instance.

removeEventSubscriber() 공개 메소드

Removes an event subscriber from the dispatcher.
또한 보기: EventDispatcherInterface::removeSubscriber()
public removeEventSubscriber ( Symfony\Component\EventDispatcher\EventSubscriberInterface $subscriber ) : static
$subscriber Symfony\Component\EventDispatcher\EventSubscriberInterface The subscriber to remove.
리턴 static The current instance.

removeStyle() 공개 메소드

Removes a style from the style set.
또한 보기: StyleSet::remove()
public removeStyle ( string $tag ) : static
$tag string The tag of the style to remove.
리턴 static The current instance.

setCatchExceptions() 공개 메소드

Sets whether the application catches and displays exceptions thrown while running a command.
또한 보기: isExceptionCaught()
public setCatchExceptions ( boolean $catch ) : static
$catch boolean Whether to catch and display exceptions thrown while running a command.
리턴 static The current instance.

setCommandConfigs() 공개 메소드

Sets the command configurations of the application.
또한 보기: beginCommand()
public setCommandConfigs ( array $configs ) : static
$configs array The command configurations.
리턴 static The current instance.

setCommandResolver() 공개 메소드

Sets the used command resolver.
또한 보기: getCommandResolver()
public setCommandResolver ( Webmozart\Console\Api\Resolver\CommandResolver $commandResolver ) : static
$commandResolver Webmozart\Console\Api\Resolver\CommandResolver The command resolver.
리턴 static The current instance.

setDebug() 공개 메소드

In debug mode, the verbosity is always {@link IO::DEBUG}.
또한 보기: isDebug()
public setDebug ( boolean $debug ) : static
$debug boolean Set to `true` to activate the debug mode.
리턴 static The current instance.

setDisplayName() 공개 메소드

Sets the application name as it is displayed in the help.
또한 보기: getDisplayName()
public setDisplayName ( string $displayName ) : static
$displayName string The display name.
리턴 static The current instance.

setEventDispatcher() 공개 메소드

Sets the event dispatcher for dispatching the console events.
public setEventDispatcher ( Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher = null ) : static
$dispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface The event dispatcher.
리턴 static The current instance.

setHelp() 공개 메소드

Sets the help text of the application.
public setHelp ( string $help ) : static
$help string The help text.
리턴 static The current instance.

setIOFactory() 공개 메소드

The callable receives four arguments: * {@link RawArgs}: The raw console arguments. * {@link Input}: The input. * {@link Output}: The output. * {@link Output}: The error output. The input and output instances may be null if none were passed to {@link Application::run()}.
public setIOFactory ( callable $ioFactory ) : static
$ioFactory callable The {@link IO} factory callable.
리턴 static The current instance.

setName() 공개 메소드

Sets the name of the application.
또한 보기: getName()
public setName ( string $name ) : static
$name string The application name.
리턴 static The current instance.

setStyleSet() 공개 메소드

Sets the used style set.
또한 보기: getStyleSet()
public setStyleSet ( StyleSet $styleSet ) : static
$styleSet Webmozart\Console\Api\Formatter\StyleSet The style set to use.
리턴 static The current instance.

setTerminateAfterRun() 공개 메소드

Sets whether to terminate the PHP process after running a command.
또한 보기: isTerminatedAfterRun()
public setTerminateAfterRun ( boolean $terminate ) : static
$terminate boolean Whether to terminate the PHP process after running a command.
리턴 static The current instance.

setVersion() 공개 메소드

Sets the version of the application.
public setVersion ( string $version ) : static
$version string The application version.
리턴 static The current instance.