RedispatchHook
class RedispatchHook implements InitializeHookInterface, ConfigAwareInterface, SiteAliasManagerAwareInterface (View source)
The RedispatchHook is installed as an init hook that runs before all commands. If the commandline contains an alias or a site specification that points at a remote machine, then we will stop execution of the current command and instead run the command remotely.
Traits
Methods
Replaces same method in ConfigAwareTrait in order to provide a DrushConfig as return type. Helps with IDE completion.
Check to see if it is necessary to redispatch to a remote site.
Check to see if the target of the command is remote. Call redispatch if it is.
Called from RemoteCommandProxy::execute() to run remote commands.
Remove anything that is not necessary for the remote side.
Abort the current execution without causing distress to our shutdown handler.
Details
DrushConfig
getConfig()
Replaces same method in ConfigAwareTrait in order to provide a DrushConfig as return type. Helps with IDE completion.
__construct(ProcessManager $processManager)
No description
initialize(InputInterface $input, AnnotationData $annotationData)
Check to see if it is necessary to redispatch to a remote site.
We do not redispatch to local sites here; usually, local sites may simply be selected and require no redispatch. When a local redispatch is needed, it happens in the RedispatchToSiteLocal class.
redispatchIfRemote(InputInterface $input)
Check to see if the target of the command is remote. Call redispatch if it is.
never
redispatch(InputInterface $input)
Called from RemoteCommandProxy::execute() to run remote commands.
protected array
alterArgsForRedispatch(array $redispatchArgs)
Remove anything that is not necessary for the remote side.
At the moment this is limited to configuration options provided via -D.
protected never
exitEarly(int $exit_code)
Abort the current execution without causing distress to our shutdown handler.