mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
PR review changes
This commit is contained in:
18
lib/cmd.php
18
lib/cmd.php
@@ -196,3 +196,21 @@ function runSQLScript($sScript, $bfatal = true, $bVerbose = false, $bIgnoreError
|
||||
fail("pgsql returned with error code ($iReturn)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function runWithEnv($cmd, $env)
|
||||
{
|
||||
$fds = array(0 => array('pipe', 'r'),
|
||||
1 => STDOUT,
|
||||
2 => STDERR);
|
||||
$pipes = null;
|
||||
$proc = @proc_open($cmd, $fds, $pipes, null, $env);
|
||||
if (!is_resource($proc)) {
|
||||
fail('unable to run command:' . $cmd);
|
||||
}
|
||||
|
||||
fclose($pipes[0]); // no stdin
|
||||
|
||||
$stat = proc_close($proc);
|
||||
return $stat;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user