summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2013-12-31 16:38:58 +0100
committerRemi Collet <fedora@famillecollet.com>2013-12-31 16:38:58 +0100
commit3838d25cd66208203cdf528e7b98dc2e06533d7b (patch)
tree1543656409ee8dd6718c532551d4a3846f628c17
parent44f9a8715a684cc1e3ef0b97f9bffe577f0161f3 (diff)
php-sabre-vobject: improved autoloader patch to avoid issue when old version, from pear channel is installed
-rw-r--r--php-sabre-vobject.spec6
-rw-r--r--sabre-vobject-bin.patch13
2 files changed, 13 insertions, 6 deletions
diff --git a/php-sabre-vobject.spec b/php-sabre-vobject.spec
index cfe56ec..3387bbc 100644
--- a/php-sabre-vobject.spec
+++ b/php-sabre-vobject.spec
@@ -15,7 +15,7 @@
Name: php-%{gh_project}
Summary: Library to parse and manipulate iCalendar and vCard objects
Version: 3.1.3
-Release: 1%{?dist}
+Release: 2%{?dist}
URL: https://github.com/%{gh_owner}/%{gh_project}
Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}.tar.gz
@@ -100,5 +100,9 @@ phpunit \
%changelog
+* Tue Dec 31 2013 Remi Collet <remi@fedoraproject.org> - 3.1.3-2
+- improved autoloader patch to avoid issue when old
+ version, from pear channel is installed
+
* Tue Dec 31 2013 Remi Collet <remi@fedoraproject.org> - 3.1.3-1
- Initial packaging \ No newline at end of file
diff --git a/sabre-vobject-bin.patch b/sabre-vobject-bin.patch
index 8ae240b..3185e6e 100644
--- a/sabre-vobject-bin.patch
+++ b/sabre-vobject-bin.patch
@@ -1,6 +1,6 @@
---- bin/vobject.old 2013-12-31 15:54:44.000000000 +0100
-+++ bin/vobject 2013-12-31 15:57:44.000000000 +0100
-@@ -1,24 +1,17 @@
+--- bin/vobject.old 2013-12-31 16:24:36.000000000 +0100
++++ bin/vobject 2013-12-31 16:32:00.000000000 +0100
+@@ -1,24 +1,21 @@
-#!/usr/bin/env php
+#!/usr/bin/php
<?php
@@ -13,14 +13,17 @@
- __DIR__ . '/../vendor/autoload.php', // In case vobject is cloned directly
- __DIR__ . '/../../../autoload.php', // In case vobject is a composer dependency.
-);
--
++// Simple PSR-0 autoloader
++// dont rely on include path as pear directory
++// may contains old incompatible version
+
-foreach($paths as $path) {
- if (file_exists($path)) {
- include $path;
- break;
+spl_autoload_register(function ($class) {
+ if (strpos($class, 'Sabre\\')===0) {
-+ $file = str_replace('\\', '/', $class).'.php';
++ $file = '/usr/share/php/'.str_replace('\\', '/', $class).'.php';
+ @include $file;
}
-}