Exemple #1
0
 /**
  * Initialize the application
  *
  * @return Console
  */
 public function initialize()
 {
     // Register an autoloader
     $this->registerLoader();
     // Load the config
     $config = new Config(__ROOT__ . '/app/cfg/config.ini');
     // Set environment settings
     $config->set('env', (new Config(__ROOT__ . '/app/cfg/env.ini'))->{$config->app->env});
     $this->config = $config;
     // Register modules
     $console = $config->modules->console;
     $this->setModules($config->{$console->modules}->toArray());
     // Register services
     $this->registerServices();
     return $this;
 }
Exemple #2
0
 /**
  * Initialize the application
  *
  * @return Application
  */
 public function initialize()
 {
     // Register an autoloader
     $this->registerLoader();
     // Load the config
     $config = new Ini(__ROOT__ . '/app/cfg/config.ini');
     // Set environment settings
     $config->set('env', (new Ini(__ROOT__ . '/app/cfg/env.ini'))->{$config->app->env});
     $config->set('assets', new Json(__ROOT__ . '/app/cfg/assets.json'));
     $this->config = $config;
     // Register modules
     $application = $config->modules->application;
     $this->setModules($config->{$application->modules}->toArray());
     // Register services
     $this->registerServices();
     return $this;
 }