4 $root = dirname(dirname(dirname(__FILE__
)));
5 require_once $root.'/scripts/init/init-script.php';
7 $xml = $root.'/externals/cldr/cldr_windows_timezones.xml';
8 $xml = Filesystem
::readFile($xml);
9 $xml = new SimpleXMLElement($xml);
11 $result_map = array();
21 $ignore = array_fuse($ignore);
23 $zones = $xml->windowsZones
->mapTimezones
->mapZone
;
24 foreach ($zones as $zone) {
25 $windows_name = (string)$zone['other'];
26 $target_name = (string)$zone['type'];
28 // Ignore the offset-based timezones from the CLDR map, since we handle
30 if (isset($ignore[$windows_name])) {
34 // We've already seen this timezone so we don't need to add it to the map
36 if (isset($result_map[$windows_name])) {
40 $result_map[$windows_name] = $target_name;
45 echo id(new PhutilJSON())
46 ->encodeFormatted($result_map);