From 8e72e51b21df393c5dc91380bf234efdf89cec03 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Tue, 22 Mar 2016 16:15:02 +0100 Subject: 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. --- lib/autoloader.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') 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(); -- cgit v1.2.3