Example #1
0
 /**
  * Run initialize after services were registered.
  */
 public function init()
 {
     $this->event->trigger('phifty.before_init');
     $self = $this;
     $this->web = function () use($self) {
         return new \Phifty\Web($self);
     };
     // Turn off all error reporting
     if ($this->isDev || $this->isCLI) {
         \Phifty\Environment\Development::init($this);
     } else {
         \Phifty\Environment\Production::init($this);
     }
     if ($this->isCLI) {
         \Phifty\Environment\CommandLine::init($this);
     }
     if (isset($this->session)) {
         $this->session;
     }
     if (isset($this->locale)) {
         $this->locale;
     }
     if ($appconfigs = $this->config->get('framework', 'Applications')) {
         foreach ($appconfigs as $appname => $appconfig) {
             $this->loadApp($appname, $appconfig);
         }
     }
     $this->event->trigger('phifty.after_init');
 }
Example #2
0
 /**
  * Run initialize after services were registered.
  */
 public function init()
 {
     $this->event->trigger('phifty.before_init');
     $self = $this;
     $this->web = function () use($self) {
         return new Web($self);
     };
     if (CLI) {
         CommandLine::init($this);
     } else {
         if (isset($this->session)) {
             $this->session;
         }
     }
     if (isset($this->locale)) {
         $this->locale;
     }
     $this->app = \App\App::getInstance($this, []);
     $this->app->init();
     $this->bundles->init();
     $this->event->trigger('phifty.after_init');
 }