Allow multiple paths for exists

This commit is contained in:
Dennis Eichhorn 2018-03-29 13:39:23 +02:00 committed by GitHub
parent 067af207df
commit 3c466931c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -96,6 +96,12 @@ class Autoloader
$class = ltrim($class, '\\'); $class = ltrim($class, '\\');
$class = str_replace(['_', '\\'], '/', $class); $class = str_replace(['_', '\\'], '/', $class);
return file_exists(__DIR__ . '/../' . $class . '.php'); foreach (self::$paths as $path) {
if (file_exists($file = $path . $class . '.php')) {
return true;
}
}
return false;
} }
} }