Projects
Kolab:16:Testing:Candidate
php-sabre-vobject
sabre-vobject-bin.patch
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File sabre-vobject-bin.patch of Package php-sabre-vobject
diff -up bin/vobject.psr0 bin/vobject --- bin/vobject.psr0 2014-04-06 09:55:39.145932310 +0200 +++ bin/vobject 2014-04-06 09:59:04.416686079 +0200 @@ -1,24 +1,21 @@ -#!/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. -); +// 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 = '/usr/share/php/'.str_replace('\\', '/', $class).'.php'; + @include $file; } -} +}); if (!class_exists('Sabre\\VObject\\Version')) { - fwrite(STDERR, "Composer autoloader could not be loaded.\n"); + fwrite(STDERR, "Autoloader could not be properly loaded.\n"); die(1); }
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.