You are here

protected function RoboFile::runDrush in Panopoly 7

Runs Drush directly (not via Robo's ExecTask).

This should primarily be used for gathering information, and not performing build steps - that should be done via Robo's ExecTask when possible.

Parameters

string $command: The Drush command and arguments to run.

string|null $cwd: The working directory.

array|null $env: The environment.

string|null $input: The standard input.

int|null $timeout: The timeout.

Return value

\Symfony\Component\Process\Process The executed Process object.

Throws

\Symfony\Component\Process\Exception\ProcessFailedException When Drush exits with a non-zero status.

3 calls to RoboFile::runDrush()
RoboFile::checkMakefile in ./RoboFile.php
Checks if the .make file for Drupal.org compatibility.
RoboFile::checkOverridden in ./RoboFile.php
Checks if any of the features are overridden.
RoboFile::isModuleEnabled in ./RoboFile.php
Checks if a module (or modules is enabled).

File

./RoboFile.php, line 88

Class

RoboFile
This is project's console commands configuration for Robo task runner.

Code

protected function runDrush($command, $cwd = NULL, array $env = NULL, $input = NULL, $timeout = NULL) {
  $drush_path = getenv('DRUSH') ?: 'drush';
  $drush_args = getenv('DRUSH_ARGS') ?: '';
  $process = new Process("{$drush_path} {$drush_args} {$command}", $cwd, $env, $input, $timeout);
  $process
    ->setPty(TRUE);
  $process
    ->mustRun();
  return $process;
}