X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/ac116980ac78b74dbc1e0ae7ff2d329d7e581ba5..992d3faac81baa105c92874a412ebf5389c0ca14:/utils/specialphrases.php?ds=sidebyside diff --git a/utils/specialphrases.php b/utils/specialphrases.php index d2bc7041..8e8ea63c 100644 --- a/utils/specialphrases.php +++ b/utils/specialphrases.php @@ -11,20 +11,24 @@ $aCMDOptions array('quiet', 'q', 0, 1, 0, 0, 'bool', 'Quiet output'), array('verbose', 'v', 0, 1, 0, 0, 'bool', 'Verbose output'), array('wiki-import', '', 0, 1, 0, 0, 'bool', 'Create import script for search phrases '), + array('project-dir', '', 0, 1, 1, 1, 'realpath', 'Base directory of the Nominatim installation (default: .)'), ); getCmdOpt($_SERVER['argv'], $aCMDOptions, $aCMDResult, true, true); +loadSettings($aCMDResult['project-dir'] ?? getcwd()); setupHTTPProxy(); -include(CONST_Phrase_Config); +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); @@ -147,7 +151,7 @@ if ($aCMDResult['wiki-import']) { . ";\n", pg_escape_string($aPair[0]), pg_escape_string($aPair[1]), - CONST_Database_Web_User + getSetting('DATABASE_WEBUSER'); ); }