Skip to content

Commit

Permalink
[jan] Update to VObject 2.1.4.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed May 2, 2014
1 parent 001cc2d commit 0338bc7
Show file tree
Hide file tree
Showing 8 changed files with 136 additions and 78 deletions.
12 changes: 6 additions & 6 deletions framework/Dav/bundle/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 19 additions & 5 deletions framework/Dav/bundle/vendor/composer/ClassLoader.php
Expand Up @@ -291,8 +291,25 @@ public function findFile($class)
return $this->classMap[$class];
}

$file = $this->findFileWithExtension($class, '.php');

// Search for Hack files if we are running on HHVM
if ($file === null && defined('HHVM_VERSION')) {
$file = $this->findFileWithExtension($class, '.hh');
}

if ($file === null) {
// Remember that this class does not exist.
return $this->classMap[$class] = false;
}

return $file;
}

private function findFileWithExtension($class, $ext)
{
// PSR-4 lookup
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . '.php';
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;

$first = $class[0];
if (isset($this->prefixLengthsPsr4[$first])) {
Expand Down Expand Up @@ -321,7 +338,7 @@ public function findFile($class)
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
} else {
// PEAR-like class name
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . '.php';
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
}

if (isset($this->prefixesPsr0[$first])) {
Expand All @@ -347,9 +364,6 @@ public function findFile($class)
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
return $file;
}

// Remember that this class does not exist.
return $this->classMap[$class] = false;
}
}

Expand Down
8 changes: 4 additions & 4 deletions framework/Dav/bundle/vendor/composer/autoload_real.php
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInitc562fe218aedadaac32a85aba4917654
class ComposerAutoloaderInit45841609c804036a124a143aa43b8843
{
private static $loader;

Expand All @@ -19,9 +19,9 @@ public static function getLoader()
return self::$loader;
}

spl_autoload_register(array('ComposerAutoloaderInitc562fe218aedadaac32a85aba4917654', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit45841609c804036a124a143aa43b8843', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInitc562fe218aedadaac32a85aba4917654', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit45841609c804036a124a143aa43b8843', 'loadClassLoader'));

$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
Expand All @@ -47,7 +47,7 @@ public static function getLoader()
}
}

function composerRequirec562fe218aedadaac32a85aba4917654($file)
function composerRequire45841609c804036a124a143aa43b8843($file)
{
require $file;
}
100 changes: 50 additions & 50 deletions framework/Dav/bundle/vendor/composer/installed.json
@@ -1,54 +1,4 @@
[
{
"name": "sabre/vobject",
"version": "2.1.3",
"version_normalized": "2.1.3.0",
"source": {
"type": "git",
"url": "https://github.com/fruux/sabre-vobject.git",
"reference": "e46d6855cfef23318e7c422cd08d36e344624675"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fruux/sabre-vobject/zipball/e46d6855cfef23318e7c422cd08d36e344624675",
"reference": "e46d6855cfef23318e7c422cd08d36e344624675",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"php": ">=5.3.1"
},
"time": "2013-10-02 15:57:01",
"bin": [
"bin/vobjectvalidate.php"
],
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-0": {
"Sabre\\VObject": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Evert Pot",
"email": "evert@rooftopsolutions.nl",
"homepage": "http://www.rooftopsolutions.nl/",
"role": "Developer"
}
],
"description": "The VObject library for PHP allows you to easily parse and manipulate iCalendar and vCard objects",
"homepage": "https://github.com/fruux/sabre-vobject",
"keywords": [
"VObject",
"iCalendar",
"vCard"
]
},
{
"name": "sabre/dav",
"version": "1.8.9",
Expand Down Expand Up @@ -126,5 +76,55 @@
"framework",
"iCalendar"
]
},
{
"name": "sabre/vobject",
"version": "2.1.4",
"version_normalized": "2.1.4.0",
"source": {
"type": "git",
"url": "https://github.com/fruux/sabre-vobject.git",
"reference": "199b6ec87104b05e3013dfd5b90eafbbe4cf97dc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fruux/sabre-vobject/zipball/199b6ec87104b05e3013dfd5b90eafbbe4cf97dc",
"reference": "199b6ec87104b05e3013dfd5b90eafbbe4cf97dc",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"php": ">=5.3.1"
},
"time": "2014-03-30 23:01:06",
"bin": [
"bin/vobjectvalidate.php"
],
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-0": {
"Sabre\\VObject": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Evert Pot",
"email": "evert@rooftopsolutions.nl",
"homepage": "http://evertpot.com/",
"role": "Developer"
}
],
"description": "The VObject library for PHP allows you to easily parse and manipulate iCalendar and vCard objects",
"homepage": "https://github.com/fruux/sabre-vobject",
"keywords": [
"VObject",
"iCalendar",
"vCard"
]
}
]
Expand Up @@ -456,11 +456,8 @@ public function __construct(Component $vcal, $uid=null) {

foreach(explode(',', (string)$exDate) as $exceptionDate) {

try {
$this->exceptionDates[] =
DateTimeParser::parse($exceptionDate, $this->startDate->getTimeZone());
} catch (\LogicException $e) {
}
$this->exceptionDates[] =
DateTimeParser::parse($exceptionDate, $this->startDate->getTimeZone());

}

Expand Down
Expand Up @@ -298,6 +298,36 @@ class TimeZoneUtil {
'Fiji' => 'Pacific/Fiji',
'New Zealand' => 'Pacific/Auckland',
'Tonga' => 'Pacific/Tongatapu',

// PHP 5.5.10 failed on a few timezones that were valid before. We're
// normalizing them here.
'CST6CDT' => 'America/Chicago',
'Cuba' => 'America/Havana',
'Egypt' => 'Africa/Cairo',
'Eire' => 'Europe/Dublin',
'EST5EDT' => 'America/New_York',
'Factory' => 'UTC',
'GB-Eire' => 'Europe/London',
'GMT0' => 'UTC',
'Greenwich' => 'UTC',
'Hongkong' => 'Asia/Hong_Kong',
'Iceland' => 'Atlantic/Reykjavik',
'Iran' => 'Asia/Tehran',
'Israel' => 'Asia/Jerusalem',
'Jamaica' => 'America/Jamaica',
'Japan' => 'Asia/Tokyo',
'Kwajalein' => 'Pacific/Kwajalein',
'Libya' => 'Africa/Tripoli',
'MST7MDT' => 'America/Denver',
'Navajo' => 'America/Denver',
'NZ-CHAT' => 'Pacific/Chatham',
'Poland' => 'Europe/Warsaw',
'Portugal' => 'Europe/Lisbon',
'PST8PDT' => 'America/Los_Angeles',
'Singapore' => 'Asia/Singapore',
'Turkey' => 'Europe/Istanbul',
'Universal' => 'UTC',
'W-SU' => 'Europe/Moscow',
);

/**
Expand Down Expand Up @@ -408,9 +438,21 @@ class TimeZoneUtil {
static public function getTimeZone($tzid, Component $vcalendar = null, $failIfUncertain = false) {

// First we will just see if the tzid is a support timezone identifier.
try {
return new \DateTimeZone($tzid);
} catch (\Exception $e) {
//
// The only exception is if the timezone starts with (. This is to
// handle cases where certain microsoft products generate timezone
// identifiers that for instance look like:
//
// (GMT+01.00) Sarajevo/Warsaw/Zagreb
//
// Since PHP 5.5.10, the first bit will be used as the timezone and
// this method will return just GMT+01:00. This is wrong, because it
// doesn't take DST into account.
if ($tzid[0]!=='(') {
try {
return new \DateTimeZone($tzid);
} catch (\Exception $e) {
}
}

// Next, we check if the tzid is somewhere in our tzid map.
Expand All @@ -420,6 +462,12 @@ static public function getTimeZone($tzid, Component $vcalendar = null, $failIfUn

// Maybe the author was hyper-lazy and just included an offset. We
// support it, but we aren't happy about it.
//
// Note that the path in the source will never be taken from PHP 5.5.10
// onwards. PHP 5.5.10 supports the "GMT+0100" style of format, so it
// already gets returned early in this function. Once we drop support
// for versions under PHP 5.5.10, this bit can be taken out of the
// source.
if (preg_match('/^GMT(\+|-)([0-9]{4})$/', $tzid, $matches)) {
return new \DateTimeZone('Etc/GMT' . $matches[1] . ltrim(substr($matches[2],0,2),'0'));
}
Expand All @@ -443,10 +491,7 @@ static public function getTimeZone($tzid, Component $vcalendar = null, $failIfUn
$lic = substr($lic,8);
}

try {
return new \DateTimeZone($lic);
} catch (\Exception $e) {
}
return self::getTimeZone($lic, null, $failIfUncertain);

}
// Microsoft may add a magic number, which we also have an
Expand Down
Expand Up @@ -14,7 +14,7 @@ class Version {
/**
* Full version number
*/
const VERSION = '2.1.3';
const VERSION = '2.1.4';

/**
* Stability : alpha, beta, stable
Expand Down
2 changes: 2 additions & 0 deletions framework/Dav/package.xml
Expand Up @@ -21,6 +21,7 @@
</stability>
<license uri="http://www.horde.org/licenses/bsd">BSD-2-Clause</license>
<notes>
* [jan] Update to VObject 2.1.4.
* [jan] Add Danish translation (Erling Preben Hansen &lt;erling@eph.dk&gt;).
</notes>
<contents>
Expand Down Expand Up @@ -752,6 +753,7 @@
<date>2014-05-02</date>
<license uri="http://www.horde.org/licenses/bsd">BSD-2-Clause</license>
<notes>
* [jan] Update to VObject 2.1.4.
* [jan] Add Danish translation (Erling Preben Hansen &lt;erling@eph.dk&gt;).
</notes>
</release>
Expand Down

0 comments on commit 0338bc7

Please sign in to comment.