mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-13 06:14:07 +00:00
Changed phrase_settings.py to phrase-settings.json and added migration function for old php settings file.
This commit is contained in:
19
lib-php/migration/phraseSettingsToJson.php
Normal file
19
lib-php/migration/phraseSettingsToJson.php
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$phpPhraseSettingsFile = $argv[1];
|
||||||
|
$jsonPhraseSettingsFile = dirname($phpPhraseSettingsFile).'/'.basename($phpPhraseSettingsFile, '.php').'.json';
|
||||||
|
|
||||||
|
if (file_exists($phpPhraseSettingsFile) && !file_exists($jsonPhraseSettingsFile)) {
|
||||||
|
include $phpPhraseSettingsFile;
|
||||||
|
|
||||||
|
$data = array();
|
||||||
|
|
||||||
|
if (isset($aTagsBlacklist))
|
||||||
|
$data['blackList'] = $aTagsBlacklist;
|
||||||
|
if (isset($aTagsWhitelist))
|
||||||
|
$data['whiteList'] = $aTagsWhitelist;
|
||||||
|
|
||||||
|
$jsonFile = fopen($jsonPhraseSettingsFile, 'w');
|
||||||
|
fwrite($jsonFile, json_encode($data));
|
||||||
|
fclose($jsonFile);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user