From: ThomasBarris Date: Sat, 8 Sep 2018 07:26:23 +0000 (+0200) Subject: move checkModilePresence to class, delete own debug echo X-Git-Tag: v3.3.0~84^2~4 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/9e35e5c2b02887e361972ffbb20e65bbba0d02c7?ds=inline move checkModilePresence to class, delete own debug echo --- diff --git a/lib/classes/SetupClass.php b/lib/classes/SetupClass.php index 120f625e..09f37e51 100755 --- a/lib/classes/SetupClass.php +++ b/lib/classes/SetupClass.php @@ -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) diff --git a/utils/update.php b/utils/update.php index 3f9bf93a..0e12bb86 100755 --- a/utils/update.php +++ b/utils/update.php @@ -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();