diff options
Diffstat (limited to 'lib/autoloader.php')
-rw-r--r-- | lib/autoloader.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/autoloader.php b/lib/autoloader.php index 41a040b3f54..8361f31b038 100644 --- a/lib/autoloader.php +++ b/lib/autoloader.php @@ -51,7 +51,9 @@ class Autoloader { * @param string[] $validRoots */ public function __construct(array $validRoots) { - $this->validRoots = $validRoots; + foreach ($validRoots as $root) { + $this->validRoots[$root] = true; + } } /** @@ -60,7 +62,8 @@ class Autoloader { * @param string $root */ public function addValidRoot($root) { - $this->validRoots[] = stream_resolve_include_path($root); + $root = stream_resolve_include_path($root); + $this->validRoots[$root] = true; } /** @@ -126,7 +129,7 @@ class Autoloader { } protected function isValidPath($fullPath) { - foreach ($this->validRoots as $root) { + foreach ($this->validRoots as $root => $true) { if (substr($fullPath, 0, strlen($root) + 1) === $root . '/') { return true; } |