GlobalOptionsEventListener
class GlobalOptionsEventListener implements EventSubscriberInterface, ConfigAwareInterface (View source)
Traits
Properties
protected ConfigInterface | $config | from ConfigAwareTrait | |
protected Application | $application | ||
protected string | $prefix |
Methods
Any class that uses ConfigAwareTrait SHOULD override this method , and define a prefix for its configuration items. This is usually done in a base class. When used, this method should return a string that ends with a "."; see BaseTask::configPrefix().
No description
No description
GlobalOptionsEventListener listener
Stipulate the prefix to use for option injection.
{@inheritdoc}
Run all of our individual operations when a command event is received.
Before a Console command runs, examine the global commandline options from the event Input, and set configuration values as appropriate.
Examine the commandline --define / -D options, and apply the provided values to the active configuration.
Split up the key=value config setting into its component parts. If the input string contains no '=' character, then the value will be 'true'.
Get default option values from the Symfony Console application, if it is available.
Details
$this
setConfig(ConfigInterface $config)
Set the config management object.
ConfigInterface
getConfig()
Get the config management object.
static protected string
configPrefix()
Any class that uses ConfigAwareTrait SHOULD override this method , and define a prefix for its configuration items. This is usually done in a base class. When used, this method should return a string that ends with a "."; see BaseTask::configPrefix().
static protected
configClassIdentifier($classname)
No description
static protected
configPostfix()
No description
static
configure(string $key, mixed $value, ConfigInterface|null $config = null)
No description
protected mixed|null
getConfigValue(string $key, mixed|null $default = null)
No description
__construct()
GlobalOptionsEventListener listener
$this
setApplication(Application $application)
Add a reference to the Symfony Console application object.
$this
setGlobalOptionsPrefix(string $prefix)
Stipulate the prefix to use for option injection.
static
getSubscribedEvents()
{@inheritdoc}
handleCommandEvent(ConsoleCommandEvent $event)
Run all of our individual operations when a command event is received.
setGlobalOptions(ConsoleCommandEvent $event)
Before a Console command runs, examine the global commandline options from the event Input, and set configuration values as appropriate.
setConfigurationValues(ConsoleCommandEvent $event)
Examine the commandline --define / -D options, and apply the provided values to the active configuration.
protected array
splitConfigKeyValue(string $value)
Split up the key=value config setting into its component parts. If the input string contains no '=' character, then the value will be 'true'.
protected array
applicationOptionDefaultValues()
Get default option values from the Symfony Console application, if it is available.