refactor the library detection in the autoloader.

This commit is contained in:
Taylor Otwell 2011-11-01 00:00:10 -05:00
parent c0c8108399
commit 82b75166ac
1 changed files with 3 additions and 3 deletions

View File

@ -67,14 +67,14 @@ protected static function find($class)
} }
} }
// If the namespace exists in the libraries directory, we will assume the // If the file exists as-is in the libraries directory, we will assume the
// library is PSR-0 compliant, and will add the namespace to the array of // library is PSR-0 compliant, and will add the namespace to the array of
// libraries and load the class accordingly. // libraries and load the class accordingly.
if (is_dir(LIBRARY_PATH.$namespace)) if (file_exists($path = LIBRARY_PATH.str_replace('_', '/', $file)))
{ {
static::$libraries[] = $namespace; static::$libraries[] = $namespace;
return LIBRARY_PATH.str_replace('_', '/', $file); return $path;
} }
} }