Dont bother with stream_resolve_include_path if the path is already absolute

This commit is contained in:
Robin Appelman 2015-11-27 14:12:14 +01:00
parent 8fe878afe9
commit 50474c6041
1 changed files with 5 additions and 1 deletions

View File

@ -170,7 +170,11 @@ class Autoloader {
// No cache or cache miss
$pathsToRequire = array();
foreach ($this->findClass($class) as $path) {
$fullPath = stream_resolve_include_path($path);
if ($path[0] === '/') {
$fullPath = file_exists($path) ? $path : false;
} else {
$fullPath = stream_resolve_include_path($path);
}
if ($fullPath && $this->isValidPath($fullPath)) {
$pathsToRequire[] = $fullPath;
}