[Pkg-owncloud-commits] [php-sabre-vobject] 27/43: Always mapping 'workaround identifiers'
David Prévot
taffit at moszumanska.debian.org
Fri Oct 10 14:16:16 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository php-sabre-vobject.
commit fc7923ad574ee2bb69636b444346b4e776140306
Author: Dominik Tobschall <dominik at fruux.com>
Date: Tue Sep 30 15:48:49 2014 +0200
Always mapping 'workaround identifiers'
---
lib/TimeZoneUtil.php | 35 +++--------------------------------
tests/VObject/TimeZoneUtilTest.php | 6 +-----
2 files changed, 4 insertions(+), 37 deletions(-)
diff --git a/lib/TimeZoneUtil.php b/lib/TimeZoneUtil.php
index 0d1e98f..326e4d5 100644
--- a/lib/TimeZoneUtil.php
+++ b/lib/TimeZoneUtil.php
@@ -146,32 +146,15 @@ class TimeZoneUtil {
// } catch(\Exception $e) {
// }
$tzIdentifiers = \DateTimeZone::listIdentifiers();
- $tzIdentifiersWorkaround = self::getIdentifiersWorkaround();
try {
if (
(in_array($tzid, $tzIdentifiers)) ||
(preg_match('/^GMT(\+|-)([0-9]{4})$/', $tzid, $matches)) ||
- (in_array($tzid, self::getIdentifiersBC())) ||
- (
- (
- (version_compare(PHP_VERSION, '5.5.10', '<') || version_compare(PHP_VERSION, '5.5.17', '>=')) ||
- (defined('HHVM_VERSION'))
- ) &&
- (
- (isset($tzIdentifiersWorkaround[$tzid]))
- )
- )
+ (in_array($tzid, self::getIdentifiersBC()))
) {
return new \DateTimeZone($tzid);
- } elseif (
- (
- (isset($tzIdentifiersWorkaround[$tzid]))
- )
- ) {
- return new \DateTimeZone($tzIdentifiersWorkaround[$tzid]);
}
-
} catch(\Exception $e) {
}
@@ -261,7 +244,8 @@ class TimeZoneUtil {
self::$map = array_merge(
include __DIR__ . '/timezonedata/windowszones.php',
include __DIR__ . '/timezonedata/lotuszones.php',
- include __DIR__ . '/timezonedata/exchangezones.php'
+ include __DIR__ . '/timezonedata/exchangezones.php',
+ include __DIR__ . '/timezonedata/php-workaround.php'
);
}
@@ -281,17 +265,4 @@ class TimeZoneUtil {
return include __DIR__ . '/timezonedata/php-bc.php';
}
- /**
- * This method returns an array of timezone identifiers, that are only supported
- * by PHP 5.5.17 and up as well as HHVM.
- * by DateTimeZone(), but not returned by DateTimeZone::listIdentifiers()
- *
- * (See timezonedata/php-workaround.php and timezonedata php-workaround.php)
- *
- * @return array
- */
- static public function getIdentifiersWorkaround() {
- return include __DIR__ . '/timezonedata/php-workaround.php';
- }
-
}
diff --git a/tests/VObject/TimeZoneUtilTest.php b/tests/VObject/TimeZoneUtilTest.php
index 8c1d190..b78eb68 100644
--- a/tests/VObject/TimeZoneUtilTest.php
+++ b/tests/VObject/TimeZoneUtilTest.php
@@ -352,11 +352,7 @@ END:VCALENDAR
HI;
$tz = TimeZoneUtil::getTimeZone('/freeassociation.sourceforge.net/Tzfile/SystemV/EST5EDT', Reader::read($vobj), true);
- if (version_compare(PHP_VERSION, '5.5.10', '<') || version_compare(PHP_VERSION, '5.5.17', '>=') || defined('HHVM_VERSION')) {
- $ex = new \DateTimeZone('EST5EDT');
- } else {
- $ex = new \DateTimeZone('America/New_York');
- }
+ $ex = new \DateTimeZone('America/New_York');
$this->assertEquals($ex->getName(), $tz->getName());
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabre-vobject.git
More information about the Pkg-owncloud-commits
mailing list