/** * Initializes this controller by setting a default database connection. Required because the db * instance is checked in [[MigrateController::beforeAction()]]. * The database connection is updated in [[actionInstall()]] after the "db" config file has been created. */ public function init() { parent::init(); $config = $this->getConfigFile('db'); // if config doesn't exist where are installing, if it does we are updating. if ($config === false) { $this->db = Yii::createObject(['class' => $this->class]); } else { $this->db = Yii::createObject($config); } $this->migrationPath = '@bigbrush/cms/migrations'; $this->defaultAction = 'info'; }
public function init() { parent::init(); // This is required to make sure the aliases in the migrationPath are resolved $this->beforeAction(\Yii::$app->requestedAction); }