]> source.dussan.org Git - nextcloud-server.git/commitdiff
Let autoloader resolve paths under apps lib directory.
authorThomas Tanghus <thomas@tanghus.net>
Thu, 18 Apr 2013 06:30:09 +0000 (08:30 +0200)
committerThomas Tanghus <thomas@tanghus.net>
Thu, 18 Apr 2013 06:30:09 +0000 (08:30 +0200)
lib/base.php

index dde994a7e5775b7ee4f01249c5d59369afd40a14..72645d077862695595020fd0003845b701ebee1b 100644 (file)
@@ -97,8 +97,14 @@ class OC {
                        $path = 'public/' . strtolower(str_replace('\\', '/', substr($className, 3)) . '.php');
                } elseif (strpos($className, 'OCA\\') === 0) {
                        foreach (self::$APPSROOTS as $appDir) {
-                               $path = $appDir['path'] . '/' . strtolower(str_replace('\\', '/', substr($className, 3)) . '.php');
-                               $fullPath = stream_resolve_include_path($path);
+                               $path = strtolower(str_replace('\\', '/', substr($className, 4)) . '.php');
+                               $fullPath = stream_resolve_include_path($appDir['path'] . '/' . $path);
+                               if (file_exists($fullPath)) {
+                                       require_once $fullPath;
+                                       return false;
+                               }
+                               $libpath = substr($path, 0, strpos($path, '/')) . '/lib' . substr($path, strpos($path, '/'));
+                               $fullPath = stream_resolve_include_path($appDir['path'] . '/' . $libpath);
                                if (file_exists($fullPath)) {
                                        require_once $fullPath;
                                        return false;