You are here

protected function GitDirtyTreeSensorPlugin::buildCommand in Monitoring 8

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 GitDirtyTreeSensorPlugin::buildCommand()
GitDirtyTreeSensorPlugin::resultVerbose in src/Plugin/monitoring/SensorPlugin/GitDirtyTreeSensorPlugin.php
Provide additional info about sensor call.
GitDirtyTreeSensorPlugin::runCommand in src/Plugin/monitoring/SensorPlugin/GitDirtyTreeSensorPlugin.php
Run a command providing an error message.
GitDirtyTreeSensorPlugin::runSensorCommand in src/Plugin/monitoring/SensorPlugin/GitDirtyTreeSensorPlugin.php
Run the command and set the status message and the status to the result.

File

src/Plugin/monitoring/SensorPlugin/GitDirtyTreeSensorPlugin.php, line 256
Contains \Drupal\monitoring\Plugin\monitoring\SensorPlugin\GitDirtyTreeSensorPlugin.

Class

GitDirtyTreeSensorPlugin
Monitors the git repository for dirty files.

Namespace

Drupal\monitoring\Plugin\monitoring\SensorPlugin

Code

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