init() public method

public init ( Pimple\Container $container )
$container Pimple\Container
示例#1
0
 public function boot()
 {
     $this->app->loadConfig();
     $container = $this->container = new Container();
     $this->container['event_dispatcher'] = $this->event_dispatcher = new EventDispatcher();
     $this->container['app'] = $this->app;
     $this->app->setContainer($container);
     $config = $this->container['app.config'] = $this->app->getConfig();
     $this->container['logger'] = $logger = $this->app->createLogger($config->get('logger.path'), $config->get('logger.level', Logger::WARNING));
     $logger->debug('Application booted. env={env}', ['env' => $this->app->getEnv()]);
     $logger->debug('Config file loaded. config_files={files}', ['files' => implode(',', $this->app->getConfigFiles())]);
     $this->bootGlobals();
     $this->app->initHttpRequest($this->container);
     $this->app->init($this->container);
     if (!isset($this->container['router'])) {
         $this->container['router'] = new Router($this->container);
         $this->container['router']->addRoute($this->app->getRoute());
     }
     if (!isset($this->container['app.renderer'])) {
         $this->container['app.renderer'] = function () {
             return $this->createRenderer();
         };
     }
     $this->app->config($this->container);
     $this->event_dispatcher->dispatch(DietcubeEvents::BOOT, new BootEvent($this->app));
 }
 public function init(Container $container)
 {
     parent::init($container);
     // TODO: Change the autogenerated stub
 }