init() public method

Initialize the application.
public init ( )
Ejemplo n.º 1
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     $this->_modulesConfigDependency = new ExpressionDependency(['expression' => '\\Yii::$app->getModulesHash()']);
     DbState::bootstrap();
     Yii::$container->set('gromver\\modulequery\\ModuleQuery', ['cache' => $this->cache, 'cacheDependency' => new ExpressionDependency(['expression' => '\\Yii::$app->getModulesHash()'])]);
 }
Ejemplo n.º 2
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     $this->trigger(self::EVENT_ON_INIT);
     if ($this->isDatabaseInstalled()) {
         $baseUrl = Setting::get('baseUrl');
         Yii::setAlias("@web", $baseUrl);
         $this->urlManager->scriptUrl = $baseUrl;
     }
 }
Ejemplo n.º 3
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     $this->trigger(self::EVENT_ON_INIT);
     if ($this->isDatabaseInstalled()) {
         $baseUrl = Yii::$app->settings->get('baseUrl');
         if ($baseUrl !== null) {
             Yii::setAlias("@web", $baseUrl);
             $this->urlManager->scriptUrl = $baseUrl;
             $this->urlManager->baseUrl = $baseUrl;
             // Set hostInfo based on given baseUrl
             $urlParts = parse_url($baseUrl);
             $hostInfo = $urlParts['scheme'] . '://' . $urlParts['host'];
             if (isset($urlParts['port'])) {
                 $hostInfo .= ':' . $urlParts['port'];
             }
             $this->urlManager->hostInfo = $hostInfo;
         }
     }
 }
Ejemplo n.º 4
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     $this->bootstrap = array_merge($this->bootstrap, ['grom']);
     parent::init();
 }