PreflightArgs
class PreflightArgs extends Config implements PreflightArgsInterface (View source)
Storage for arguments preprocessed during preflight.
Holds @sitealias, if present, and a limited number of global options.
TODO: The methods here with >~3 lines of logic could be refactored into a couple of different classes e.g. a helper to convert preflight args to configuration, and another to prepare the input object.
Constants
DRUSH_CONFIG_PATH_NAMESPACE |
|
DRUSH_RUNTIME_CONTEXT_NAMESPACE |
|
ALIAS |
|
ALIAS_PATH |
|
COMMAND_PATH |
|
CONFIG_PATH |
|
COVERAGE_FILE |
|
LOCAL |
|
ROOT |
|
URI |
|
SIMULATE |
|
STRICT |
|
DEBUG |
|
Properties
protected array | $args | ||
protected string | $homeDir | ||
protected | $commandName |
Methods
No description
No description
PreflightArgs constructor
No description
If the user enters '--help' or '-h', thrown that option away and add a 'help' command to the beginning of the argument list.
Map of option key to the corresponding config key to store the preflight option in. The values of the config items in this map must be BOOLEANS or STRINGS.
Map of path option keys to the corresponding config key to store the preflight option in. The values of the items in this map must be STRINGS or ARRAYS OF STRINGS.
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Get the selected site. Here, the default will typically be the cwd.
No description
Set the selected site.
Get the selected uri
No description
Set the uri option
Get the config path where drush.yml files may be found
Add another location where drush.yml files may be found
Add multiple additional locations where drush.yml files may be found.
Get the alias paths where drush site.site.yml files may be found
Set one more path where aliases may be found.
Get the path where Drush commandfiles e.g. FooCommands.php may be found.
Add one more path where commandfiles might be found.
Add multiple paths where commandfiles might be found.
Determine whether Drush is in "local" mode
Set local mode
Determine whether Drush is in "simulated" mode.
Set simulated mode
Get the path to the coverage file.
Set the coverage file path.
Determine whether Drush is in "strict" mode or not.
Set strict mode.
Search through the provided argv list, and return just the option name of any item that is an option.
Create a Symfony Input object.
Details
string
homeDir()
No description
void
setHomeDir(string $homeDir)
No description
__construct(array $data = [])
PreflightArgs constructor
array
optionsWithValues()
No description
void
adjustHelpOption()
If the user enters '--help' or '-h', thrown that option away and add a 'help' command to the beginning of the argument list.
protected array
optionConfigMap()
Map of option key to the corresponding config key to store the preflight option in. The values of the config items in this map must be BOOLEANS or STRINGS.
protected array
optionConfigPathMap()
Map of path option keys to the corresponding config key to store the preflight option in. The values of the items in this map must be STRINGS or ARRAYS OF STRINGS.
applyToConfig(ConfigInterface $config)
No description
args()
No description
applicationPath()
No description
commandName()
No description
setCommandName($commandName)
No description
addArg(string $arg)
No description
passArgs($args)
No description
alias()
No description
hasAlias()
No description
setAlias(string $alias)
No description
selectedSite($default = false)
Get the selected site. Here, the default will typically be the cwd.
void
setDebug($value)
No description
PreflightArgs
setSelectedSite($root)
Set the selected site.
uri($default = false)
Get the selected uri
bool
hasUri()
No description
PreflightArgs
setUri($uri)
Set the uri option
configPaths()
Get the config path where drush.yml files may be found
PreflightArgs
addConfigPath(string $path)
Add another location where drush.yml files may be found
PreflightArgs
mergeConfigPaths(array $configPaths)
Add multiple additional locations where drush.yml files may be found.
aliasPaths()
Get the alias paths where drush site.site.yml files may be found
PreflightArgs
addAliasPath(string $path)
Set one more path where aliases may be found.
commandPaths()
Get the path where Drush commandfiles e.g. FooCommands.php may be found.
PreflightArgs
addCommandPath(string $path)
Add one more path where commandfiles might be found.
PreflightArgs
mergeCommandPaths($commandPaths)
Add multiple paths where commandfiles might be found.
isLocal()
Determine whether Drush is in "local" mode
PreflightArgs
setLocal(bool $isLocal)
Set local mode
isSimulated()
Determine whether Drush is in "simulated" mode.
PreflightArgs
setSimulate(bool $simulate)
Set simulated mode
coverageFile()
Get the path to the coverage file.
PreflightArgs
setCoverageFile(string $coverageFile)
Set the coverage file path.
isStrict()
Determine whether Drush is in "strict" mode or not.
PreflightArgs
setStrict(bool $strict)
Set strict mode.
protected array
getOptionNameList(array $argv)
Search through the provided argv list, and return just the option name of any item that is an option.
InputInterface
createInput()
Create a Symfony Input object.