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.
This commit is contained in:
parent
ffe57a55d9
commit
8e72e51b21
|
@ -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…
Reference in New Issue