]> git.openstreetmap.org Git - nominatim.git/blob - lib-php/migration/phraseSettingsToJson.php
10500eebf40830989ad89116cc724986e4511de6
[nominatim.git] / lib-php / migration / phraseSettingsToJson.php
1 <?php
2
3 $phpPhraseSettingsFile = $argv[1];
4 $jsonPhraseSettingsFile = dirname($phpPhraseSettingsFile).'/'.basename($phpPhraseSettingsFile, '.php').'.json';
5
6 if (file_exists($phpPhraseSettingsFile) && !file_exists($jsonPhraseSettingsFile)) {
7     include $phpPhraseSettingsFile;
8
9     $data = array();
10
11     if (isset($aTagsBlacklist))
12         $data['blackList'] = $aTagsBlacklist;
13     if (isset($aTagsWhitelist))
14         $data['whiteList'] = $aTagsWhitelist;
15
16     $jsonFile = fopen($jsonPhraseSettingsFile, 'w');
17     fwrite($jsonFile, json_encode($data));
18     fclose($jsonFile);
19 }