aboutsummaryrefslogtreecommitdiffstats
path: root/lib/autoloader.php
diff options
context:
space:
mode:
authorGeorg Ehrke <developer@georgehrke.com>2014-06-04 11:34:09 +0200
committerGeorg Ehrke <developer@georgehrke.com>2014-06-04 11:34:09 +0200
commit2c00ab13cf1dca45035e88ecad854997f78cf51c (patch)
tree3a96053670c66c5da9e6039fb38396651eb32e3d /lib/autoloader.php
parent56a8010c9fee7e6063b10abcf89a09a47c2f5984 (diff)
downloadnextcloud-server-2c00ab13cf1dca45035e88ecad854997f78cf51c.tar.gz
nextcloud-server-2c00ab13cf1dca45035e88ecad854997f78cf51c.zip
update autoloader
Diffstat (limited to 'lib/autoloader.php')
-rw-r--r--lib/autoloader.php11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/autoloader.php b/lib/autoloader.php
index 2ce36385081..da20a2a0250 100644
--- a/lib/autoloader.php
+++ b/lib/autoloader.php
@@ -89,12 +89,11 @@ class Autoloader {
} elseif (strpos($class, 'OCA\\') === 0) {
list(, $app, $rest) = explode('\\', $class, 3);
$app = strtolower($app);
- foreach (\OC::$APPSROOTS as $appDir) {
- if (stream_resolve_include_path($appDir['path'] . '/' . $app)) {
- $paths[] = $appDir['path'] . '/' . $app . '/' . strtolower(str_replace('\\', '/', $rest) . '.php');
- // If not found in the root of the app directory, insert '/lib' after app id and try again.
- $paths[] = $appDir['path'] . '/' . $app . '/lib/' . strtolower(str_replace('\\', '/', $rest) . '.php');
- }
+ $appPath = \OC_App::getAppPath($app);
+ if (stream_resolve_include_path($appPath)) {
+ $paths[] = $appPath . '/' . strtolower(str_replace('\\', '/', $rest) . '.php');
+ // If not found in the root of the app directory, insert '/lib' after app id and try again.
+ $paths[] = $appPath . '/lib/' . strtolower(str_replace('\\', '/', $rest) . '.php');
}
} elseif (strpos($class, 'Test_') === 0) {
$paths[] = 'tests/lib/' . strtolower(str_replace('_', '/', substr($class, 5)) . '.php');