Nette\Configurator::fixCompatibility PHP Method

fixCompatibility() protected method

Back compatibility with < v2.3
protected fixCompatibility ( $config ) : array
return array
    protected function fixCompatibility($config)
    {
        if (isset($config['nette']['security']['frames'])) {
            $config['nette']['http']['frames'] = $config['nette']['security']['frames'];
            unset($config['nette']['security']['frames']);
        }
        foreach (['application', 'cache', 'database', 'di' => 'container', 'forms', 'http', 'latte', 'mail' => 'mailer', 'routing', 'security', 'session', 'tracy' => 'debugger'] as $new => $old) {
            if (isset($config['nette'][$old])) {
                $new = is_int($new) ? $old : $new;
                if (isset($config[$new])) {
                    throw new Nette\DeprecatedException("You can use (deprecated) section 'nette.{$old}' or new section '{$new}', but not both of them.");
                } else {
                    trigger_error("Configuration section 'nette.{$old}' is deprecated, use section '{$new}' (without 'nette')", E_USER_DEPRECATED);
                }
                $config[$new] = $config['nette'][$old];
                unset($config['nette'][$old]);
            }
        }
        if (isset($config['nette']['xhtml'])) {
            trigger_error("Configuration option 'nette.xhtml' is deprecated, use section 'latte.xhtml' instead.", E_USER_DEPRECATED);
            $config['latte']['xhtml'] = $config['nette']['xhtml'];
            unset($config['nette']['xhtml']);
        }
        if (empty($config['nette'])) {
            unset($config['nette']);
        }
        return $config;
    }