return join(' ', $aEscaped);
}
- public function run()
+ public function run($bExitOnFail = false)
{
$sCmd = $this->escapedCmd();
// $aEnv does not need escaping, proc_open seems to handle it fine
fclose($aPipes[0]); // no stdin
$iStat = proc_close($hProc);
+
+ if ($iStat != 0 && $bExitOnFail) {
+ exit($iStat);
+ }
+
return $iStat;
}