public function actionInit()
	{
		if (!InstallerModule::checkDbConnection())
			Yii::$app->db->open();

		// Flush the caches
		if (Yii::$app->cache) {
			Yii::$app->cache->flush();
		}

		// todo make migration better
		$data = file_get_contents((dirname(__DIR__) . '/migrations/data.sql'));
		Yii::$app->db->createCommand($data)->execute();

		return $this->redirect(Yii::$app->urlManager->createUrl('//installer/config/index'));
	}
public function actionInit()
	{
		if (!InstallerModule::checkDbConnection())
			Yii::$app->db->open();

		// Flush the caches
		if (Yii::$app->cache) {
			Yii::$app->cache->flush();
		}

		// todo make migration better
		$data = file_get_contents((dirname(__DIR__) . '/migrations/data.sql'));
		Yii::$app->db->createCommand($data)->execute();

		return $this->redirect(Yii::$app->urlManager->createUrl('//installer/config/index'));
	}
public function actionInit ( ) { if ( ! InstallerModule :: checkDbConnection ( ) ) Yii :: $ app -> db -> open ( ) ; // Flush the caches if ( Yii :: $ app -> cache ) { Yii :: $ app -> cache -> flush ( ) ; } // todo make migration better $ data = file_get_contents ( ( dirname ( __DIR__ ) . '/migrations/data.sql' ) ) ; Yii :: $ app -> db -> createCommand ( $ data ) -> execute ( ) ; return $ this -> redirect ( Yii :: $ app -> urlManager -> createUrl ( '//installer/config/index' ) ) ; }
The init action imports the database structure & initial data
The init action imports the database structure & initial data