mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-08-07 05:52:18 -04:00
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.
This commit is contained in:
parent
81e9c8672f
commit
c62a3fbd2d
1 changed files with 0 additions and 4 deletions
|
@ -190,8 +190,6 @@ class Controller
|
||||||
*/
|
*/
|
||||||
private function _setDefaultLanguage()
|
private function _setDefaultLanguage()
|
||||||
{
|
{
|
||||||
$this->_conf = new Configuration;
|
|
||||||
|
|
||||||
$lang = $this->_conf->getKey('languagedefault');
|
$lang = $this->_conf->getKey('languagedefault');
|
||||||
I18n::setLanguageFallback($lang);
|
I18n::setLanguageFallback($lang);
|
||||||
// force default language, if language selection is disabled and a default is set
|
// force default language, if language selection is disabled and a default is set
|
||||||
|
@ -208,8 +206,6 @@ class Controller
|
||||||
*/
|
*/
|
||||||
private function _setDefaultTemplate()
|
private function _setDefaultTemplate()
|
||||||
{
|
{
|
||||||
$this->_conf = new Configuration;
|
|
||||||
|
|
||||||
$templates = $this->_conf->getKey('availabletemplates');
|
$templates = $this->_conf->getKey('availabletemplates');
|
||||||
$template = $this->_conf->getKey('template');
|
$template = $this->_conf->getKey('template');
|
||||||
TemplateSwitcher::setAvailableTemplates($templates);
|
TemplateSwitcher::setAvailableTemplates($templates);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue