yii\console\Application::loadConfig PHP Method

loadConfig() protected method

This method will check if the command line option [[OPTION_APPCONFIG]] is specified. If so, the corresponding file will be loaded as the application configuration. Otherwise, the configuration provided as the parameter will be returned back.
protected loadConfig ( array $config ) : array
$config array the configuration provided in the constructor.
return array the actual configuration to be used by the application.
    protected function loadConfig($config)
    {
        if (!empty($_SERVER['argv'])) {
            $option = '--' . self::OPTION_APPCONFIG . '=';
            foreach ($_SERVER['argv'] as $param) {
                if (strpos($param, $option) !== false) {
                    $path = substr($param, strlen($option));
                    if (!empty($path) && is_file($file = Yii::getAlias($path))) {
                        return require $file;
                    } else {
                        exit("The configuration file does not exist: {$path}\n");
                    }
                }
            }
        }
        return $config;
    }