Example #1
0
 public function actionFinal()
 {
     $model = new FinalStep();
     $model->serverName = Yii::$app->request->serverName;
     if (extension_loaded('memcached') || extension_loaded('memcache')) {
         $model->cacheClass = 'yii\\caching\\MemCache';
         if (extension_loaded('memcached')) {
             $model->useMemcached = true;
         }
     }
     if (Yii::$app->request->serverPort !== 80) {
         $model->serverPort = Yii::$app->request->serverPort;
     }
     if ($model->load(Yii::$app->request->post()) && $model->validate()) {
         if (InstallerHelper::writeCommonConfig($model) && InstallerHelper::updateConfigurables()) {
             return $this->redirect(['complete']);
         } else {
             Yii::$app->session->setFlash('warning', Yii::t('app', 'Unable to write common-local.php'));
         }
     }
     $cacheClasses = ['yii\\caching\\FileCache', 'yii\\caching\\MemCache', 'yii\\caching\\XCache', 'yii\\caching\\ZendDataCache', 'yii\\caching\\ApcCache'];
     return $this->render('final', ['model' => $model, 'cacheClasses' => $cacheClasses]);
 }