From 7194cb3795582d5f9d1ae5e4e4f7464cdba8a95a Mon Sep 17 00:00:00 2001 From: Awilum Date: Sat, 12 Oct 2019 21:31:01 +0300 Subject: [PATCH] fix(core): fix Plugins API - createPluginsDictionary method and increase app perfomance #259 --- flextype/core/Plugins.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/flextype/core/Plugins.php b/flextype/core/Plugins.php index 257aed51..7d664cdd 100755 --- a/flextype/core/Plugins.php +++ b/flextype/core/Plugins.php @@ -51,7 +51,7 @@ class Plugins * * @access public */ - public function getLocales() : array + public function getLocales() { return $this->locales; } @@ -90,9 +90,10 @@ class Plugins } else { // Save plugins dictionary $dictionary = $this->getPluginsDictionary($plugins_list, $locale); - $this->flextype['cache']->save($locale, $dictionary); + $this->flextype['cache']->save($locale, $dictionary[$locale]); } + } else { // If Plugins List isnt empty if (is_array($plugins_list) && count($plugins_list) > 0) { @@ -158,7 +159,7 @@ class Plugins // Save plugins dictionary $dictionary = $this->getPluginsDictionary($plugins_list, $locale); - $this->flextype['cache']->save($locale, $dictionary); + $this->flextype['cache']->save($locale, $dictionary[$locale]); } }