]> git.openstreetmap.org Git - nominatim.git/blobdiff - utils/specialphrases.php
switch remaining settings to dotenv format
[nominatim.git] / utils / specialphrases.php
index 9e6c9d76c757a38c70ba4a722207881c13368e98..58e06222b31015d92d43ad9d920d3ab9e9c741ce 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-require_once(CONST_BasePath.'/lib/init-cmd.php');
+require_once(CONST_LibDir.'/init-cmd.php');
 ini_set('memory_limit', '800M');
 ini_set('display_errors', 'stderr');
 
@@ -14,15 +14,19 @@ $aCMDOptions
   );
 getCmdOpt($_SERVER['argv'], $aCMDOptions, $aCMDResult, true, true);
 
-include(CONST_Phrase_Config);
+setupHTTPProxy();
+
+include(getSettingConfig('PHRASE_CONFIG', 'phrase_settings.php'));
 
 if ($aCMDResult['wiki-import']) {
-    $oNormalizer = Transliterator::createFromRules(CONST_Term_Normalization_Rules);
+    $oNormalizer = Transliterator::createFromRules(getSetting('TERM_NORMALIZATION'));
     $aPairs = array();
 
-    $sLanguageIn = CONST_Languages ? CONST_Languages :
-        ('af,ar,br,ca,cs,de,en,es,et,eu,fa,fi,fr,gl,hr,hu,'.
-         'ia,is,it,ja,mk,nl,no,pl,ps,pt,ru,sk,sl,sv,uk,vi');
+    $sLanguageIn = getSetting(
+        LANGUAGES,
+        'af,ar,br,ca,cs,de,en,es,et,eu,fa,fi,fr,gl,hr,hu,'.
+        'ia,is,it,ja,mk,nl,no,pl,ps,pt,ru,sk,sl,sv,uk,vi';
+    );
 
     foreach (explode(',', $sLanguageIn) as $sLanguage) {
         $sURL = 'https://wiki.openstreetmap.org/wiki/Special:Export/Nominatim/Special_Phrases/'.strtoupper($sLanguage);
@@ -145,7 +149,7 @@ if ($aCMDResult['wiki-import']) {
             . ";\n",
             pg_escape_string($aPair[0]),
             pg_escape_string($aPair[1]),
-            CONST_Database_Web_User
+            getSetting('DATABASE_WEBUSER');
         );
     }