X-Git-Url: https://git.openstreetmap.org/nominatim.git/blobdiff_plain/6a7e0d652b1d40a397e1c1386d500101796676c4..7e6125ada5b46a7d7e510e19ece3acc319cd476d:/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; }