summaryrefslogtreecommitdiffstats
path: root/sabre-vobject-bin.patch
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2013-12-31 16:06:52 +0100
committerRemi Collet <fedora@famillecollet.com>2013-12-31 16:06:52 +0100
commit44f9a8715a684cc1e3ef0b97f9bffe577f0161f3 (patch)
tree791f44ea127c345ed256740707c00600d9f1e64b /sabre-vobject-bin.patch
php-sabre-vobject: 3.1.3: new package
Diffstat (limited to 'sabre-vobject-bin.patch')
-rw-r--r--sabre-vobject-bin.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/sabre-vobject-bin.patch b/sabre-vobject-bin.patch
new file mode 100644
index 0000000..8ae240b
--- /dev/null
+++ b/sabre-vobject-bin.patch
@@ -0,0 +1,34 @@
+--- 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 @@
+-#!/usr/bin/env php
++#!/usr/bin/php
+ <?php
+
+ namespace Sabre\VObject;
+
+-// This sucks.. we have to try to find the composer autoloader. But chances
+-// are, we can't find it this way. So we'll do our bestest
+-$paths = array(
+- __DIR__ . '/../vendor/autoload.php', // In case vobject is cloned directly
+- __DIR__ . '/../../../autoload.php', // In case vobject is a composer dependency.
+-);
+-
+-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';
++ @include $file;
+ }
+-}
++});
+
+ if (!class_exists('Sabre\\VObject\\Version')) {
+- fwrite(STDERR, "Composer autoloader could not be properly loaded.\n");
++ fwrite(STDERR, "Autoloader could not be properly loaded.\n");
+ die(1);
+ }
+