mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-22 22:15:12 +00:00
745515b11f
We use composer already to install SabreDAV. Include config composer.(json|lock) to install and manage more dependencies in future. Also provide PSR-4 autoloading for our namespaced classes, e.g. "Zotlabs\". To regenerate autoloader maps use: $ composer install --optimize-autoloader --no-dev We could also remove the whole vendor/ folder from our repository, but that would need changes in deployment and how to install hubs and needs more discussion first.
51 lines
1.3 KiB
PHP
Executable file
51 lines
1.3 KiB
PHP
Executable file
#!/usr/bin/env php
|
|
<?php
|
|
|
|
$windowsZonesUrl = 'http://unicode.org/repos/cldr/trunk/common/supplemental/windowsZones.xml';
|
|
$outputFile = __DIR__ . '/../lib/timezonedata/windowszones.php';
|
|
|
|
echo "Fetching timezone map from: " . $windowsZonesUrl, "\n";
|
|
|
|
$data = file_get_contents($windowsZonesUrl);
|
|
|
|
$xml = simplexml_load_string($data);
|
|
|
|
$map = [];
|
|
|
|
foreach ($xml->xpath('//mapZone') as $mapZone) {
|
|
|
|
$from = (string)$mapZone['other'];
|
|
$to = (string)$mapZone['type'];
|
|
|
|
list($to) = explode(' ', $to, 2);
|
|
|
|
if (!isset($map[$from])) {
|
|
$map[$from] = $to;
|
|
}
|
|
|
|
}
|
|
|
|
ksort($map);
|
|
echo "Writing to: $outputFile\n";
|
|
|
|
$f = fopen($outputFile, 'w');
|
|
fwrite($f, "<?php\n\n");
|
|
fwrite($f, "/**\n");
|
|
fwrite($f, " * Automatically generated timezone file\n");
|
|
fwrite($f, " *\n");
|
|
fwrite($f, " * Last update: " . date(DATE_W3C) . "\n");
|
|
fwrite($f, " * Source: " . $windowsZonesUrl . "\n");
|
|
fwrite($f, " *\n");
|
|
fwrite($f, " * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/).\n");
|
|
fwrite($f, " * @license http://sabre.io/license/ Modified BSD License\n");
|
|
fwrite($f, " */\n");
|
|
fwrite($f, "\n");
|
|
fwrite($f, "return ");
|
|
fwrite($f, var_export($map, true) . ';');
|
|
fclose($f);
|
|
|
|
echo "Formatting\n";
|
|
|
|
exec(__DIR__ . '/sabre-cs-fixer fix ' . escapeshellarg($outputFile));
|
|
|
|
echo "Done\n";
|