From 098c6c6295872b3b01fa4aae281c615de00818bc Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 30 Jan 2013 19:46:36 -0600 Subject: [PATCH] tweak how autoloader works. --- app/config/app.php | 2 +- app/start/global.php | 4 ++-- bootstrap/autoload.php | 13 +++++++++++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/app/config/app.php b/app/config/app.php index 8fb1035e..4a29b10e 100644 --- a/app/config/app.php +++ b/app/config/app.php @@ -142,7 +142,7 @@ 'Auth' => 'Illuminate\Support\Facades\Auth', 'Blade' => 'Illuminate\Support\Facades\Blade', 'Cache' => 'Illuminate\Support\Facades\Cache', - 'ClassLoader' => 'Illuminate\Foundation\ClassLoader', + 'ClassLoader' => 'Illuminate\Support\ClassLoader', 'Config' => 'Illuminate\Support\Facades\Config', 'Controller' => 'Illuminate\Routing\Controllers\Controller', 'Cookie' => 'Illuminate\Support\Facades\Cookie', diff --git a/app/start/global.php b/app/start/global.php index dbebd1f4..c6bad0d1 100644 --- a/app/start/global.php +++ b/app/start/global.php @@ -11,12 +11,12 @@ | */ -ClassLoader::register(new ClassLoader(array( +ClassLoader::addDirectories(array( app_path().'/controllers', app_path().'/models', -))); +)); /* |-------------------------------------------------------------------------- diff --git a/bootstrap/autoload.php b/bootstrap/autoload.php index f6adac71..5030dae4 100644 --- a/bootstrap/autoload.php +++ b/bootstrap/autoload.php @@ -14,6 +14,19 @@ require __DIR__.'/../vendor/autoload.php'; +/* +|-------------------------------------------------------------------------- +| Register The Laravel Auto Loader +|-------------------------------------------------------------------------- +| +| We register an auto-loader "behind" the Composer loader that can load +| model classes on the fly, even if the autoload files have not been +| regenerated for the application. We'll add it to the stack here. +| +*/ + +Illuminate\Support\ClassLoader::register(); + /* |-------------------------------------------------------------------------- | Register The Workbench Loaders