summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2013-04-18 08:30:09 +0200
committerThomas Tanghus <thomas@tanghus.net>2013-04-18 08:30:09 +0200
commit9facb67fab0cc9556e681ff75ec59218eb2ba34b (patch)
treec152c06097b278effc26491b9a6c8c7fe646d692
parenta3e5da834bb2a0697d5e301eb74bbbc423301913 (diff)
downloadnextcloud-server-9facb67fab0cc9556e681ff75ec59218eb2ba34b.tar.gz
nextcloud-server-9facb67fab0cc9556e681ff75ec59218eb2ba34b.zip
Let autoloader resolve paths under apps lib directory.
-rw-r--r--lib/base.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/base.php b/lib/base.php
index dde994a7e57..72645d07786 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -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;