summaryrefslogtreecommitdiffstats
path: root/lib/autoloader.php
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2016-03-22 16:15:02 +0100
committerLukas Reschke <lukas@owncloud.com>2016-03-22 16:19:12 +0100
commit8e72e51b21df393c5dc91380bf234efdf89cec03 (patch)
tree86a51c9846326c80fd48f6384ce6cdeecbaa90b9 /lib/autoloader.php
parentffe57a55d973e244fc84573323e3da8512e1ac95 (diff)
downloadnextcloud-server-8e72e51b21df393c5dc91380bf234efdf89cec03.tar.gz
nextcloud-server-8e72e51b21df393c5dc91380bf234efdf89cec03.zip
Dont double load class
If the class already exists we should not load it twice. Since the composer autoloader is also used in core this could otherwise load a file twice. This leads to problems otherwise with case insensitive operating systems like OS X. We can get rid of this once all file names in OC follow PSR-4, until then we probably need this check.
Diffstat (limited to 'lib/autoloader.php')
-rw-r--r--lib/autoloader.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/autoloader.php b/lib/autoloader.php
index e7262af0ca9..87a07f6da12 100644
--- a/lib/autoloader.php
+++ b/lib/autoloader.php
@@ -164,6 +164,10 @@ class Autoloader {
$pathsToRequire = $this->memoryCache->get($class);
}
+ if(class_exists($class, false)) {
+ return false;
+ }
+
if (!is_array($pathsToRequire)) {
// No cache or cache miss
$pathsToRequire = array();