summaryrefslogtreecommitdiffstats
path: root/sabre-dav-autoload.patch
blob: 1aa22dbe09eb34cc9f5fa01b51bb353afd9f55cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--- lib/Sabre/autoload.php.old	2013-12-31 17:54:12.000000000 +0100
+++ lib/Sabre/autoload.php	2013-12-31 17:58:28.000000000 +0100
@@ -15,11 +15,9 @@
  * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
  */

-/**
- * We are assuming that the composer autoloader is just 2 directories up.
- *
- * This is not the case when sabredav is installed as a dependency. But, in
- * those cases it's not expected that people will look for this file anyway.
- */
-
-require __DIR__ . '/../../vendor/autoload.php';
+spl_autoload_register(function ($class) {
+    if (strpos($class,'Sabre\\')===0) {
+        $file = __DIR__ . str_replace('\\', '/', substr($class,5)).'.php';
+        @include $file;
+    }
+});