You are here

protected function SensorGitDirtyTree::buildCommand in Monitoring 7

Build the command to be passed into shell_exec().

Parameters

string $cmd: Command we want to run.

Return value

string Shell command.

3 calls to SensorGitDirtyTree::buildCommand()
SensorGitDirtyTree::resultVerbose in lib/Drupal/monitoring/Sensor/Sensors/SensorGitDirtyTree.php
Provide additional info about sensor call.
SensorGitDirtyTree::runCommand in lib/Drupal/monitoring/Sensor/Sensors/SensorGitDirtyTree.php
Run a command providing an error message.
SensorGitDirtyTree::runSensorCommand in lib/Drupal/monitoring/Sensor/Sensors/SensorGitDirtyTree.php
Run the command and set the status message and the status to the result.

File

lib/Drupal/monitoring/Sensor/Sensors/SensorGitDirtyTree.php, line 248
Contains \Drupal\monitoring\Sensor\Sensors\SensorGitDirtyTree.

Class

SensorGitDirtyTree
Monitors the git repository for dirty files.

Namespace

Drupal\monitoring\Sensor\Sensors

Code

protected function buildCommand($cmd) {
  $repo_path = DRUPAL_ROOT . '/' . $this->info
    ->getSetting('repo_path');
  $cmd = $this->info
    ->getSetting($cmd);
  return 'cd ' . escapeshellarg($repo_path) . "\n{$cmd}  2>&1";
}