Upgrade to Pro — share decks privately, control downloads, hide ads and more …

What happens in Laravel 4 bootstraping

What happens in Laravel 4 bootstraping

介紹 Laravel 4 的啟動過程

大澤木小鐵

December 16, 2014
Tweet

More Decks by 大澤木小鐵

Other Decks in Programming

Transcript

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

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

     •  bootstrap/start.php   •  
  3.  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/
  4.   hostname   $env = $app->detectEnvironment([ 'local' =>

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

    'production'; }); http://blog.wu-boy.com/2014/08/laravel-application-environments-without-hostnames/
  6. Framework  •  Facades ", ) • '+&* app/config

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

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

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

    Log   •  Exception   •    • app/filters.php
  10.  routers  app/routes.php •   (route) • 

     •  request  Controller • filter 
  11.  • Request  IoC  •  request 

      Response  • Response  
  12.  • Laravel  IoC Container  •  •

    Router / Request / Response