Webiny\Component\Bootstrap\Environment::initializeEnvironmentInternal PHP Method

initializeEnvironmentInternal() private method

Method detect the current environment and loads all the configurations from it.
    private function initializeEnvironmentInternal()
    {
        // validate the environment
        $environments = $this->applicationConfig->get('Application.Environments', false);
        if ($environments) {
            // get the production environment
            $productionEnv = $environments->get('Production', false);
            if (!$productionEnv) {
                throw new BootstrapException('Production environment must always be defined in App/Config/App.yaml');
            }
        }
        // get the name of the current environment
        $currentEnvName = $this->getCurrentEnvironmentName();
        // load the production environment configs
        $this->componentConfigs = $this->loadConfigurations('Production');
        // check if the current env is different from Production
        if ($currentEnvName != 'Production') {
            $currentConfigs = $this->loadConfigurations($currentEnvName);
            $this->componentConfigs->mergeWith($currentConfigs);
        }
    }