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.
remotes/origin/ldap-empty-hardening
Lukas Reschke 9 years ago
parent ffe57a55d9
commit 8e72e51b21
  1. 4
      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();

Loading…
Cancel
Save