From 82b75166ac7269c4bfa06d18034a7124c8e84189 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 1 Nov 2011 00:00:10 -0500 Subject: [PATCH] refactor the library detection in the autoloader. --- laravel/autoloader.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/laravel/autoloader.php b/laravel/autoloader.php index f4547e26..06604828 100644 --- a/laravel/autoloader.php +++ b/laravel/autoloader.php @@ -67,14 +67,14 @@ class Autoloader { } } - // 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 // libraries and load the class accordingly. - if (is_dir(LIBRARY_PATH.$namespace)) + if (file_exists($path = LIBRARY_PATH.str_replace('_', '/', $file))) { static::$libraries[] = $namespace; - return LIBRARY_PATH.str_replace('_', '/', $file); + return $path; } }