3 function checkInFile($sOSMFile)
5 if (!isset($sOSMFile)) {
6 fail('missing --osm-file for data import');
9 if (!file_exists($sOSMFile)) {
10 fail('the path supplied to --osm-file does not exist');
13 if (!is_readable($sOSMFile)) {
14 fail('osm-file "' . $aCMDResult['osm-file'] . '" not readable');
18 function checkModulePresence()
20 // Try accessing the C module, so we know early if something is wrong
21 // and can simply error out.
22 $sModulePath = CONST_Database_Module_Path;
23 $sSQL = "CREATE FUNCTION nominatim_test_import_func(text) RETURNS text AS '";
24 $sSQL .= $sModulePath . "/nominatim.so', 'transliteration' LANGUAGE c IMMUTABLE STRICT";
25 $sSQL .= ';DROP FUNCTION nominatim_test_import_func(text);';
28 $oResult = $oDB->query($sSQL);
32 if (PEAR::isError($oResult)) {
33 echo "\nERROR: Failed to load nominatim module. Reason:\n";
34 echo $oResult->userinfo . "\n\n";