mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
Errors fixes, Cleaning code, Improvement and addition of tests
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