diff options
author | Lukas Reschke <lukas@owncloud.com> | 2016-03-22 18:15:02 +0300 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2016-03-22 18:19:12 +0300 |
commit | 8e72e51b21df393c5dc91380bf234efdf89cec03 (patch) | |
tree | 86a51c9846326c80fd48f6384ce6cdeecbaa90b9 /lib/autoloader.php | |
parent | ffe57a55d973e244fc84573323e3da8512e1ac95 (diff) |
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.php | 4 |
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(); |