介紹 Laravel 4 的啟動過程
Laravel 4What happens in bootstrapingJace Ju @ KKBOX
View Slide
1. (request)2. " 3. ! providers4. 5. filters routers6.
• public/.htaccss (Apache)• public/index.php • • bootstrap/start.php •
Application: IoC Container// provider session $app->bindShared('session', function($app){return new SessionManager($app);});// session $session = $app['session'];http://laravel.tw/docs/iochttp://www.jaceju.net/blog/archives/php-di-container/
hostname $env = $app->detectEnvironment(['local' => ['jace-note-book'],'production' => ['web-machine-1', 'web-machine-2'],]);testing
$env = $app->detectEnvironment(function () {return 'production';});http://blog.wu-boy.com/2014/08/laravel-application-environments-without-hostnames/
• bootstrap/paths.php• Laravel Framework start.php
Framework • Facades ",)• '+&* app/config "• ( production +&* #• Exception• "% timezone• ).- $!http://laravel.tw/docs/facades
providers• app/config/app.php providers • app/storage/meta/services.json ()• # • "! IoC container
Provider • (Eager loading)• (Event loading)• console mode (Deferred loading)
app/start/global.php• !• Log • Exception • • app/filters.php
app/start/{env}.php • app/start/local.php• app/start/production.php
routers app/routes.php• (route)• • request Controller• filter
• Request IoC • request Response • Response
• Laravel IoC Container • • Router / Request / Response