]> git.openstreetmap.org Git - nominatim.git/commitdiff
move checkModilePresence to class, delete own debug echo
authorThomasBarris <thomas.barris@googlemail.com>
Sat, 8 Sep 2018 07:26:23 +0000 (09:26 +0200)
committerThomasBarris <thomas.barris@googlemail.com>
Sat, 8 Sep 2018 07:26:23 +0000 (09:26 +0200)
lib/classes/SetupClass.php
utils/update.php

index 120f625eadd8b5a44429614a7503d7e2fe9516e7..09f37e515bbee4f102e5fe2d89fdf6807ac7c1e8 100755 (executable)
@@ -136,6 +136,11 @@ class SetupFunctions
             exit(1);
         }
 
+        // Try accessing the C module, so we know early if something is wrong
+        if (!checkModulePresence()) {
+            fail('error loading nominatim.so module');
+        }
+
         if (!file_exists(CONST_ExtraDataPath.'/country_osm_grid.sql.gz')) {
             echo 'Error: you need to download the country_osm_grid first:';
             echo "\n    wget -O ".CONST_ExtraDataPath."/country_osm_grid.sql.gz https://www.nominatim.org/data/country_grid.sql.gz\n";
@@ -219,6 +224,11 @@ class SetupFunctions
     {
         info('Create Functions');
 
+        // Try accessing the C module, so we know eif something is wrong
+        // update.php calls this function
+        if (!checkModulePresence()) {
+            fail('error loading nominatim.so module');
+        }
         $this->createSqlFunctions();
     }
 
@@ -330,7 +340,6 @@ class SetupFunctions
         } else {
             warn('wikipedia redirect dump file not found - some place importance values may be missing');
         }
-        echo ' finish wikipedia';
     }
 
     public function loadData($bDisableTokenPrecalc)
index 3f9bf93a5d2d447a19b02d7dce48c3548411397e..0e12bb8671e4f3ed8c66612f8e2f52fb634a5084 100755 (executable)
@@ -71,10 +71,6 @@ if ($aResult['init-updates']) {
     }
 
     if (!$aResult['no-update-functions']) {
-        // Try accessing the C module,
-        if (!checkModulePresence()) {
-            fail('error loading nominatim.so module');
-        }
         // instantiate setupClass to use the function therein
         $cSetup = new SetupFunctions($aResult);
         $cSetup->createFunctions();