Change the active Config back to the Config instance the current active
Config object was copied from.

@return ConfigCollectionInterface
510762
public static function unnest()
    {
        // Unnest unless we would be left at 0 manifests
        $loader = ConfigLoader::inst();
        if ($loader->countManifests() <= 1) {
            user_error(
                "Unable to unnest root Config, please make sure you don't have mis-matched nest/unnest",
                E_USER_WARNING
            );
        } else {
            $loader->popManifest();
        }
        return static::inst();
    }
1350329
public static function fromConfig()
	{
		$mailer = self::getInstance();

		$services = Config::get ('mailer.services');

		if (!$services) {
			return $mailer;
		}

		foreach ($services as $k => $v) {
			$service = MapperFactory::getServiceMapper()->getFromToken($k);
			if ($service) {
				$service->setFromConfig ($v);
				$mailer->addService ($service);
			}
		}

		return $mailer;
	}
311692
public function adapt()
    {
        if (method_exists($this, $this->adaptMethodName) && $this->data) {
            call_user_func([$this, $this->adaptMethodName]);
        }

        return $this;
    }
567373
protected function getSettingsInstance()
    {
        if (isset($this->settings)) {
            return $this->settings;
        }

        $settingsConfig = $this->getSettingsConfig();

        return $this->settings = new Settings($settingsConfig, $this);
    }
667262
protected function getProfileConfig()
    {
        $configCallable = $this->config;
        $config = $configCallable($this->getProfileConfigKey());

        if (!is_array($config)) {
            $config = [$config];
        }

        return array_filter($config);
    }
154000
public function restoreConfigScope()
    {
        $event = new ScopeChangeEvent($this->originalSiteAccess);
        $this->eventDispatcher->dispatch(MVCEvents::CONFIG_SCOPE_RESTORE, $event);

        return $event->getSiteAccess();
    }
117034
protected function _getConf()
    {
        // retrieve and cache config
        $services = $this->services();

        /** @var aSapi $config */
        $config   = $services->get('/sapi');
        $orig = $config   = $config->config();
        /** @var DataEntity $config */
        $config   = $config->get(\Module\Authorization\Module::CONF, array());

        if (!isset($config[self::CONF]) && !is_array($config[self::CONF]))
            return null;


        $config   = $config[self::CONF];
        return $config;
    }
364440
public function addConfig()
    {
        $params = func_get_args();

        if (!empty($params)) {
            if (is_array($params[0])) {
                forward_static_call_array([Configuration::class, 'setMany'], $params);
            } else {
                forward_static_call_array([Configuration::class, 'set'], $params);
            }
        }

        return $this;
    }
997613
public function getConfiguration()
    {
        $configuration = $this->configuration->getParameter('configuration');

        if (!is_array($configuration)) {
            throw new ConnectionException(
                sprintf(
                    "Invalid configuration. It should be an array of settings, '%s' returned.",
                    gettype($configuration)
                )
            );
        }

        return $configuration;
    }
987013
public function getConfig()
	{
		return $this->_node->__isset( 'config' ) && is_array( $this->_node->config ) ? $this->_node->__get( 'config' ) : array();
	}
652917
public function refresh()
    {
        $behaviors = $this->owner->behaviors();
        $settings = $behaviors[$this->getName()];
        foreach ($settings as $attribute=>$value) {
            if (in_array($attribute, array('class'))) {
                continue;
            }
            $this->$attribute = $value;
        }
        return $this;
    }
448783
public function getConfiguration()
    {
        if (!$this->_configuration) {

            //If model is using
            if ($this->modelClass) {

                $this->_configuration = $this->_keyStorage->get($this->getKey()) ?: [];
                $modelClass = $this->modelClass;
                if (!$this->_configuration || !($this->_configuration instanceof $modelClass)) {
                    //Initialize new model. Default values must be set in model (init method)
                    $this->_configuration = Yii::createObject($modelClass, $this->modelConfig);
                }

                //Default values from 'attributes'
                if (is_array($this->attributes)) {
                    foreach ($this->attributes as $key => $default) {
                        if ($this->_configuration->{$key} === null) {
                            $this->_configuration->{$key} = $default;
                        }
                    }
                }

            } else {

                //Array configuration
                $dbConfig = $this->_keyStorage->get($this->getKey()) ?: [];

                if (is_array($this->attributes)) {
                    //Needs to filter
                    $config = [];
                    foreach ($this->attributes as $key => $default) {
                        $config[$key] = (isset($dbConfig[$key]) && $dbConfig[$key] !== null) ? $dbConfig[$key] : $default;
                    }
                    $this->_configuration = $config;
                } else {
                    $this->_configuration = $dbConfig;
                }

            }
        }
        return $this->_configuration;
    }
881270
public static function rewriteConfiguration()
	{
		// Get Current Configuration
		$config = Configuration::get();

		// Add Application Name to Configuration
		$config['name'] = Yii::$app->config->get(Enum::APP_NAME);

		// Add Caching
		$cacheClass = Yii::$app->config->get(Enum::CACHE_CLASS);
		if (!$cacheClass) {
			$cacheClass = FileCache::className();
		}
		$config['components']['cache'] = [
			'class' => $cacheClass
		];

		// Add Auth Clients
		$config['components']['authClientCollection']['class'] = 'yii\\authclient\\Collection';

		Configuration::set($config);
	}
143432
public static function getClassConfigInherit()
    {
        $attribute = 'class-config-inherit';

        if (!static::hasClassAttribute($attribute)) {
            $class = static::getClass();
            $stack = [];
            $inherit = [];

            while ($class) {
                $stack[] = $class::getClassConfigArray();
                $class = get_parent_class($class);
            }

            $stack = array_reverse($stack);

            foreach ($stack as $config) {
                $inherit = array_replace_recursive($inherit, $config);
            }

            static::setClassAttribute($attribute, $inherit);
        }

        return static::getClassAttribute($attribute);
    }
938619
public function active()
    {
        $this->attributes['class'] = Builder::formatGroupClass(array('class' => $this->builder->conf('active_class')), $this->attributes);
        $this->isActive = true;

        return $this;
    }
761631
protected function getDefaultConfig()
    {
        $defaultConfig = [
            'denyExtensionRename' => true,
            'denyUpdateCheck' => true,
            'dirnameChangeChars' => [' ' => '_', ':' => '_'],
            'disabled' => false,
            'filenameChangeChars' => [' ' => '_', ':' => '_'],
            'jpegQuality' => 100,
            'uploadDir' => UPLOADED,
            'uploadURL' => Router::url('/files', true),
            'types' => $this->getTypes(),
        ];

        //If the user is not and admin
        if (!$this->Auth->isGroup(['admin'])) {
            //Only admins can delete or rename directories
            $defaultConfig['access']['dirs'] = [
                'create' => true,
                'delete' => false,
                'rename' => false,
            ];
            //Only admins can delete, move or rename files
            $defaultConfig['access']['files'] = [
                'upload' => true,
                'delete' => false,
                'copy' => true,
                'move' => false,
                'rename' => false,
            ];
        }

        return $defaultConfig;
    }
1331082
public function setDefaultsFromConfiguration()
    {
        $this->ignoreCache = isset($this->config["ignoreCache"])
            ? $this->config["ignoreCache"]
            : $this->ignoreCache;

        return $this;
    }