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

Inflection trait for the site alias manager.

ConfigAwareTrait

Properties

protected $siteAliasManager from  SiteAliasManagerAwareTrait

Methods

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.

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.

array
alterArgsForRedispatch(array $redispatchArgs)

Remove anything that is not necessary for the remote side.

never
exitEarly(int $exit_code)

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.

setSiteAliasManager(SiteAliasManagerInterface $siteAliasManager)

No description

Parameters

SiteAliasManagerInterface $siteAliasManager

hasSiteAliasManager()

No description

__construct(ProcessManager $processManager)

No description

Parameters

ProcessManager $processManager

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.

Parameters

InputInterface $input
AnnotationData $annotationData

redispatchIfRemote(InputInterface $input)

Check to see if the target of the command is remote. Call redispatch if it is.

Parameters

InputInterface $input

never redispatch(InputInterface $input)

Called from RemoteCommandProxy::execute() to run remote commands.

Parameters

InputInterface $input

Return Value

never

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.

Parameters

array $redispatchArgs

Return Value

array

protected never exitEarly(int $exit_code)

Abort the current execution without causing distress to our shutdown handler.

Parameters

int $exit_code .

Return Value

never