From c62a3fbd2d6219a04b358db8772026cfb5000664 Mon Sep 17 00:00:00 2001 From: Jacques Bodin-Hullin Date: Sun, 9 Mar 2025 20:23:01 +0100 Subject: [PATCH] perf(configuration): Do not create multiple instances of Configuration Since the configuration is loaded in the _init method, and this method is called in the _construct, there is no reason to instanciate the Configuration class more than once. --- lib/Controller.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/Controller.php b/lib/Controller.php index b7b7fc1d..bac65ebd 100644 --- a/lib/Controller.php +++ b/lib/Controller.php @@ -190,8 +190,6 @@ class Controller */ private function _setDefaultLanguage() { - $this->_conf = new Configuration; - $lang = $this->_conf->getKey('languagedefault'); I18n::setLanguageFallback($lang); // force default language, if language selection is disabled and a default is set @@ -208,8 +206,6 @@ class Controller */ private function _setDefaultTemplate() { - $this->_conf = new Configuration; - $templates = $this->_conf->getKey('availabletemplates'); $template = $this->_conf->getKey('template'); TemplateSwitcher::setAvailableTemplates($templates);