- $result = runWithEnv($createdbCmd, $procenv);
- if ($result != 0) fail('Error executing external command: '.$createdbCmd);
+ $result = runWithEnv($sCreateDBCmd, $aProcEnv);
+ if ($result != 0) fail('Error executing external command: '.$sCreateDBCmd);
// Try accessing the C module, so we know early if something is wrong
// and can simply error out.
$sSQL = "CREATE FUNCTION nominatim_test_import_func(text) RETURNS text AS '";
// Try accessing the C module, so we know early if something is wrong
// and can simply error out.
$sSQL = "CREATE FUNCTION nominatim_test_import_func(text) RETURNS text AS '";
- while (($pgresult = pg_get_result($aDBInstances[$i]->connection)) !== false) {
- $resultStatus = pg_result_status($pgresult);
+ while (($hPGresult = pg_get_result($aDBInstances[$i]->connection)) !== false) {
+ $resultStatus = pg_result_status($hPGresult);
// PGSQL_EMPTY_QUERY, PGSQL_COMMAND_OK, PGSQL_TUPLES_OK,
// PGSQL_COPY_OUT, PGSQL_COPY_IN, PGSQL_BAD_RESPONSE,
// PGSQL_NONFATAL_ERROR and PGSQL_FATAL_ERROR
echo 'Query result ' . $i . ' is: ' . $resultStatus . '\n';
if ($resultStatus != PGSQL_COMMAND_OK && $resultStatus != PGSQL_TUPLES_OK) {
// PGSQL_EMPTY_QUERY, PGSQL_COMMAND_OK, PGSQL_TUPLES_OK,
// PGSQL_COPY_OUT, PGSQL_COPY_IN, PGSQL_BAD_RESPONSE,
// PGSQL_NONFATAL_ERROR and PGSQL_FATAL_ERROR
echo 'Query result ' . $i . ' is: ' . $resultStatus . '\n';
if ($resultStatus != PGSQL_COMMAND_OK && $resultStatus != PGSQL_TUPLES_OK) {
if (isset($aDSNInfo['username']) && $aDSNInfo['username']) {
$sBaseCmd .= ' -U ' . $aDSNInfo['username'];
}
if (isset($aDSNInfo['username']) && $aDSNInfo['username']) {
$sBaseCmd .= ' -U ' . $aDSNInfo['username'];
}
- $status = runWithEnv($sBaseCmd.' -R 4', $procenv);
- if ($status != 0) {
- fail('error status ' . $status . ' running nominatim!');
+ $iStatus = runWithEnv($sBaseCmd.' -R 4', $aProcEnv);
+ if ($iStatus != 0) {
+ fail('error status ' . $iStatus . ' running nominatim!');
- $status = runWithEnv($sBaseCmd.' -r 5 -R 25', $procenv);
- if ($status != 0) {
- fail('error status ' . $status . ' running nominatim!');
+ $iStatus = runWithEnv($sBaseCmd.' -r 5 -R 25', $procenv);
+ if ($iStatus != 0) {
+ fail('error status ' . $iStatus . ' running nominatim!');
- $status = runWithEnv($sBaseCmd.' -r 26', $procenv);
- if ($status != 0) {
- fail('error status ' . $status . ' running nominatim!');
+ $iStatus = runWithEnv($sBaseCmd.' -r 26', $procenv);
+ if ($iStatus != 0) {
+ fail('error status ' . $iStatus . ' running nominatim!');
if (isset($aDSNInfo['username']) && $aDSNInfo['username']) {
$sCMD .= ' -U ' . $aDSNInfo['username'];
}
if (isset($aDSNInfo['username']) && $aDSNInfo['username']) {
$sCMD .= ' -U ' . $aDSNInfo['username'];
}
- $hProcess = proc_open($sCMD, $aDescriptors, $ahPipes, null, $procenv);
+ $hProcess = proc_open($sCMD, $aDescriptors, $ahPipes, null, $aProcEnv);
if (isset($aDSNInfo['username']) && $aDSNInfo['username']) {
$sCMD .= ' -U ' . $aDSNInfo['username'];
}
if (isset($aDSNInfo['username']) && $aDSNInfo['username']) {
$sCMD .= ' -U ' . $aDSNInfo['username'];
}
if ($aCMDResult['enable-diff-updates']) {
$sTemplate = str_replace('RETURN NEW; -- %DIFFUPDATES%', '--', $sTemplate);
}
if ($aCMDResult['enable-diff-updates']) {
$sTemplate = str_replace('RETURN NEW; -- %DIFFUPDATES%', '--', $sTemplate);
}