src/Console/Controllers/BaseMigrateController.php
public function beforeAction($actionId)
    {
        if (parent::beforeAction($actionId)) {
            if (empty($this->migrationNamespaces) && empty($this->migrationPath)) {
                throw new InvalidConfigException('At least one of `migrationPath` or `migrationNamespaces` should be specified.');
            }

            foreach ($this->migrationNamespaces as $key => $value) {
                $this->migrationNamespaces[$key] = trim($value, '\\');
            }

            if (is_array($this->migrationPath)) {
                foreach ($this->migrationPath as $i => $path) {
                    $this->migrationPath[$i] = \Reaction::$app->getAlias($path);
                }
            } elseif ($this->migrationPath !== null) {
                $path = \Reaction::$app->getAlias($this->migrationPath);
                if (!is_dir($path)) {
                    if ($actionId !== 'create') {
                        throw new InvalidConfigException("Migration failed. Directory specified in migrationPath doesn't exist: {$this->migrationPath}");
                    }
                    FileHelper::createDirectory($path);
                }
                $this->migrationPath = $path;
            }

            $version = \Reaction::getVersion();
            $this->stdout("Reaction Migration Tool (based on Reaction v{$version})\n\n");

            return true;
        }

        return false;
    }
public function beforeAction($actionId)
    {
        if (parent::beforeAction($actionId)) {
            if (empty($this->migrationNamespaces) && empty($this->migrationPath)) {
                throw new InvalidConfigException('At least one of `migrationPath` or `migrationNamespaces` should be specified.');
            }

            foreach ($this->migrationNamespaces as $key => $value) {
                $this->migrationNamespaces[$key] = trim($value, '\\');
            }

            if (is_array($this->migrationPath)) {
                foreach ($this->migrationPath as $i => $path) {
                    $this->migrationPath[$i] = \Reaction::$app->getAlias($path);
                }
            } elseif ($this->migrationPath !== null) {
                $path = \Reaction::$app->getAlias($this->migrationPath);
                if (!is_dir($path)) {
                    if ($actionId !== 'create') {
                        throw new InvalidConfigException("Migration failed. Directory specified in migrationPath doesn't exist: {$this->migrationPath}");
                    }
                    FileHelper::createDirectory($path);
                }
                $this->migrationPath = $path;
            }

            $version = \Reaction::getVersion();
            $this->stdout("Reaction Migration Tool (based on Reaction v{$version})\n\n");

            return true;
        }

        return false;
    }
This method is invoked right before an action is to be executed (after all possible filters.)
It checks the existence of the [[migrationPath]].
@param string $actionId the action to be executed.
@throws InvalidConfigException if directory specified in migrationPath doesn't exist and action isn't "create".
@return bool whether the action should continue to be executed.