Merge pull request #9658 from Ayesh/improve/class-autoloader-conditional-path
Minor improvement to ClassLoader::register no-op blockpull/9662/head
commit
1e72b23fd3
|
@ -311,8 +311,10 @@ class ClassLoader
|
||||||
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
|
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
|
||||||
|
|
||||||
if (null === $this->vendorDir) {
|
if (null === $this->vendorDir) {
|
||||||
//no-op
|
return;
|
||||||
} elseif ($prepend) {
|
}
|
||||||
|
|
||||||
|
if ($prepend) {
|
||||||
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
|
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
|
||||||
} else {
|
} else {
|
||||||
unset(self::$registeredLoaders[$this->vendorDir]);
|
unset(self::$registeredLoaders[$this->vendorDir]);
|
||||||
|
|
Loading…
Reference in New Issue