class ProcessManager extends ProcessManager (View source)

The Drush ProcessManager adds a few Drush-specific service methods.

Methods

SiteProcess
drush(SiteAliasInterface $siteAlias, string $command, array $args = [], array $options = [], array $options_double_dash = [])

Run a Drush command on a site alias (or @self).

ProcessBase
drushSiteProcess(SiteAliasInterface $siteAlias, array $args = [], array $options = [], array $options_double_dash = [])

drushSiteProcess should be avoided in favor of the drush method above.

drushScript(SiteAliasInterface $siteAlias)

Determine the path to Drush to use

siteProcess(SiteAliasInterface $siteAlias, $args = [], $options = [], $optionsPassedAsArgs = [])

No description

ProcessBase
process(array $commandline, string|null $cwd = null, array $env = null, mixed|null $input = null, int|float|null $timeout = 60)

Run a bash fragment locally.

Process
shell(string $command, string|null $cwd = null, array $env = null, mixed|null $input = null, int|float|null $timeout = 60)

Create a Process instance from a commandline string.

static 
configureProcess(ProcessBase $process)

configureProcess sets up a process object so that it is ready to use.

Details

SiteProcess drush(SiteAliasInterface $siteAlias, string $command, array $args = [], array $options = [], array $options_double_dash = [])

Run a Drush command on a site alias (or @self).

Parameters

SiteAliasInterface $siteAlias
string $command
array $args
array $options
array $options_double_dash

Return Value

SiteProcess

ProcessBase drushSiteProcess(SiteAliasInterface $siteAlias, array $args = [], array $options = [], array $options_double_dash = [])

drushSiteProcess should be avoided in favor of the drush method above.

drushSiteProcess exists specifically for use by the RedispatchHook, which does not have specific knowledge about which argument is the command.

Parameters

SiteAliasInterface $siteAlias
array $args
array $options
array $options_double_dash

Return Value

ProcessBase

drushScript(SiteAliasInterface $siteAlias)

Determine the path to Drush to use

Parameters

SiteAliasInterface $siteAlias

siteProcess(SiteAliasInterface $siteAlias, $args = [], $options = [], $optionsPassedAsArgs = [])

Parameters

SiteAliasInterface $siteAlias
$args
$options
$optionsPassedAsArgs

ProcessBase process(array $commandline, string|null $cwd = null, array $env = null, mixed|null $input = null, int|float|null $timeout = 60)

Run a bash fragment locally.

The timeout parameter on this method doesn't work. It exists for compatibility with parent. Call this method to get a Process and then call setters as needed.

Parameters

array $commandline The command line to run with arguments as separate items in an array
string|null $cwd The working directory or null to use the working dir of the current PHP process
array $env The environment variables or null to use the same environment as the current PHP process
mixed|null $input The input as stream resource, scalar or \Traversable, or null for no input
int|float|null $timeout The timeout in seconds or null to disable

Return Value

ProcessBase A wrapper around Symfony Process.

Process shell(string $command, string|null $cwd = null, array $env = null, mixed|null $input = null, int|float|null $timeout = 60)

Create a Process instance from a commandline string.

Parameters

string $command The commandline string to run
string|null $cwd The working directory or null to use the working dir of the current PHP process
array $env The environment variables or null to use the same environment as the current PHP process
mixed|null $input The input as stream resource, scalar or \Traversable, or null for no input
int|float|null $timeout The timeout in seconds or null to disable

Return Value

Process

static protected configureProcess(ProcessBase $process)

configureProcess sets up a process object so that it is ready to use.

Parameters

ProcessBase $process