X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/db3ced17bbfff00411f506d8c84419c875959d5e..dc700c25b66c9885acc719f7ec9761f52b586c20:/lib-php/Shell.php?ds=sidebyside 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; }