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
Inflection trait for the site alias manager.
Properties
| protected ConfigInterface | $config | from ConfigAwareTrait | |
| protected | $siteAliasManager | from SiteAliasManagerAwareTrait |
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
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
$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
setSiteAliasManager(SiteAliasManagerInterface $siteAliasManager)
No description
SiteAliasManagerInterface
siteAliasManager()
No description
hasSiteAliasManager()
No description
__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.