init() public method

Initialize the application.
public init ( )
コード例 #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()'])]);
 }
コード例 #2
0
ファイル: Application.php プロジェクト: ArneVanDaele/humhub
 /**
  * @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;
     }
 }
コード例 #3
0
ファイル: Application.php プロジェクト: kreativmind/humhub
 /**
  * @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;
         }
     }
 }
コード例 #4
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     $this->bootstrap = array_merge($this->bootstrap, ['grom']);
     parent::init();
 }