diff options
author | Remi Collet <fedora@famillecollet.com> | 2013-12-31 16:38:58 +0100 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2013-12-31 16:38:58 +0100 |
commit | 3838d25cd66208203cdf528e7b98dc2e06533d7b (patch) | |
tree | 1543656409ee8dd6718c532551d4a3846f628c17 /sabre-vobject-bin.patch | |
parent | 44f9a8715a684cc1e3ef0b97f9bffe577f0161f3 (diff) |
php-sabre-vobject: improved autoloader patch to avoid issue when old version, from pear channel is installed
Diffstat (limited to 'sabre-vobject-bin.patch')
-rw-r--r-- | sabre-vobject-bin.patch | 13 |
1 files changed, 8 insertions, 5 deletions
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; } -} |