public static function run($command, &$output = null, &$returnCode = null)
{
if (!self::allowed()) {
$message = sprintf("No PHP exec(), can not execute command '%s'.", $command);
throw new RuntimeException($message);
}
$command = $command . self::REDIRECT_STDERR_TO_STDOUT;
exec($command, $outputArray, $returnCode);
$output = self::parseCommandOutput($outputArray);
if ($returnCode !== self::CODE_CLEAN_EXIT) {
throw new RuntimeException(sprintf(sprintf("Exit status %d for command %s. Output was: %s", $returnCode, $command, $output)));
}
}