]> git.openstreetmap.org Git - nominatim.git/blob - lib-php/migration/PhraseSettingsToJson.php
test: use src_dir fixture instead of self-computed paths
[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 }