コード例 #1
0
ファイル: LoadConfiguration.php プロジェクト: Mosaic/Mosaic
 /**
  * @param Application $app
  */
 public function bootstrap(Application $app)
 {
     foreach ($this->getConfigFiles($app) as $key => $path) {
         $this->config->set($key, require $path);
     }
     $app->setEnvironment($this->config->get('app.env', 'production'));
     date_default_timezone_set($this->config->get('app.timezone', 'UTC'));
     mb_internal_encoding('UTF-8');
 }
コード例 #2
0
 /**
  * @param Router $router
  *
  * @return mixed
  */
 public function loadRoutes(Router $router)
 {
     $binders = $this->config->get($this->app->getContext() . '.routes', []);
     foreach ($binders as $binder) {
         if (!class_exists($binder)) {
             throw new InvalidArgumentException('RouteBinder [' . $binder . '] does not exist');
         }
         $this->container->make($binder)->bind($router);
     }
 }