What happens in Laravel 4 bootstraping

What happens in Laravel 4 bootstraping

介紹 Laravel 4 的啟動過程

F830ec52d5bf72ee64fd1a43a6a82a49?s=128

大澤木小鐵

December 16, 2014
Tweet

Transcript

  1. Laravel 4 What happens in bootstraping Jace Ju @ KKBOX

  2.  1.   (request) 2.  "  3.

    ! providers 4.   5.  filters  routers 6.  
  3.  •  public/.htaccss  (Apache) • public/index.php • 

     •  bootstrap/start.php   •  
  4.  Application: IoC Container //  provider   session

     $app->bindShared('session', function($app) { return new SessionManager($app); }); //    session  $session = $app['session']; http://laravel.tw/docs/ioc</sub> <sub>http://www.jaceju.net/blog/archives/php-di-container/
  5.   hostname   $env = $app->detectEnvironment([ 'local' =>

    ['jace-note-book'], 'production' => ['web-machine-1', 'web-machine-2'], ]); testing    
  6.     $env = $app->detectEnvironment(function () { return

    'production'; }); http://blog.wu-boy.com/2014/08/laravel-application-environments-without-hostnames/
  7.  •  bootstrap/paths.php •  Laravel Framework  start.php

  8. Framework  •  Facades ", ) • '+&* app/config

    " • ( production +&*  # •  Exception • "% timezone • ).- $! http://laravel.tw/docs/facades
  9.  providers •  app/config/app.php  providers  • 

    app/storage/meta/services.json  ( ) •  #   • "!  IoC container 
  10. Provider  •  (Eager loading) •   (Event

    loading) •  console mode   (Deferred loading)
  11.     app/start/global.php •  ! • 

    Log   •  Exception   •    • app/filters.php
  12.     app/start/{env}.php  • app/start/local.php • app/start/production.php

  13.  routers  app/routes.php •   (route) • 

     •  request  Controller • filter 
  14.  • Request  IoC  •  request 

      Response  • Response  
  15.  • Laravel  IoC Container  •  •

    Router / Request / Response  
  16.