Preflight
class Preflight (View source)
The Drush preflight determines what needs to be done for this request.
The preflight happens after Drush has loaded its autoload file, but prior to loading Drupal's autoload file and setting up the DI container.
- Pre-parse commandline arguments
- Read configuration .yml files
- Determine the site to use
Properties
protected Environment | $environment | ||
protected PreflightVerify | $verify | ||
protected ConfigLocator | $configLocator | ||
protected DrushDrupalFinder | $drupalFinder | ||
protected PreflightArgs | $preflightArgs | ||
protected SiteAliasManager | $aliasManager | ||
protected PreflightLog | $logger |
Methods
Preflight constructor
No description
Perform preliminary initialization. This mostly involves setting up legacy systems.
Remapping table for arguments. Anything found in a key here will be converted to the corresponding value entry.
Symfony Console dislikes certain command aliases, because they are too similar to other Drush commands that contain the same characters. To avoid the "I don't know which command you mean"-type errors, we will replace problematic aliases with their longhand equivalents.
Preprocess the args, removing any @sitealias that may be present.
Create the initial config locator object, and inject any needed settings, paths and so on into it.
No description
No description
No description
No description
No description
Find the Drupal root of the preferred Drupal site (the one
that shares the vendor
directory with Drush).
No description
No description
No description
Details
__construct(Environment $environment, $verify = null, $configLocator = null, $preflightLog = null)
Preflight constructor
PreflightLog
logger()
No description
void
setLogger(PreflightLog $logger)
No description
void
init()
Perform preliminary initialization. This mostly involves setting up legacy systems.
protected array
remapOptions()
Remapping table for arguments. Anything found in a key here will be converted to the corresponding value entry.
For example: --ssh-options='-i mysite_dsa' will become: -Dssh.options='-i mysite_dsa'
TODO: We could consider loading this from a file or some other source. However, this table is needed very early -- even earlier than config is loaded (since this is needed for preflighting the arguments, which can select config files to load). Hardcoding is probably best; we might want to move to another class, perhaps. We also need this prior to Dependency Injection, though.
Eventually, we might want to expose this table to some form of 'help' output, so folks can see the available conversions.
protected array
remapCommandAliases()
Symfony Console dislikes certain command aliases, because they are too similar to other Drush commands that contain the same characters. To avoid the "I don't know which command you mean"-type errors, we will replace problematic aliases with their longhand equivalents.
This should be fixed in Symfony Console.
PreflightArgs
preflightArgs($argv)
Preprocess the args, removing any @sitealias that may be present.
Arguments and options not used during preflight will be processed with an ArgvInput.
void
prepareConfig(Environment $environment)
Create the initial config locator object, and inject any needed settings, paths and so on into it.
InputInterface
createInput()
No description
array
getCommandFilePaths()
No description
ClassLoader
loadSymfonyCompatabilityAutoloader()
No description
DrushConfig
config()
No description
array
preflight($argv)
No description
protected
preferredSite()
Find the Drupal root of the preferred Drupal site (the one
that shares the vendor
directory with Drush).
DrushDrupalFinder
drupalFinder()
No description
SiteAliasManager
aliasManager()
No description
Environment
environment()
No description