X-Git-Url: https://git.openstreetmap.org/nominatim.git/blobdiff_plain/6a7e0d652b1d40a397e1c1386d500101796676c4..111cca8c9ab882d554b072a05d1dfe4afe58657e:/lib-php/Shell.php diff --git a/lib-php/Shell.php b/lib-php/Shell.php index 72f90735..b43db135 100644 --- a/lib-php/Shell.php +++ b/lib-php/Shell.php @@ -48,7 +48,7 @@ class Shell 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 @@ -67,6 +67,11 @@ class Shell fclose($aPipes[0]); // no stdin $iStat = proc_close($hProc); + + if ($iStat != 0 && $bExitOnFail) { + exit($iStat); + } + return $iStat; }