Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <thomas.steur@gmail.com>2015-02-02 04:56:55 +0300
committerThomas Steur <thomas.steur@gmail.com>2015-02-02 04:56:55 +0300
commite349e24aa244d7aaaa364cc326cc76285e02b143 (patch)
tree5cf1d1340479250f6b5301268ffe802105089155 /core/ViewDataTable
parent478d539a61bc40a73a908aeed65efb0728360dfc (diff)
we do request the available view datatables many times, eg when detecting the footerIcons. Instead cache the result to save many postEvents etc
Diffstat (limited to 'core/ViewDataTable')
-rw-r--r--core/ViewDataTable/Manager.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/ViewDataTable/Manager.php b/core/ViewDataTable/Manager.php
index 5d05650657..aff1774368 100644
--- a/core/ViewDataTable/Manager.php
+++ b/core/ViewDataTable/Manager.php
@@ -8,6 +8,7 @@
*/
namespace Piwik\ViewDataTable;
+use Piwik\Cache;
use Piwik\Common;
use Piwik\Option;
use Piwik\Piwik;
@@ -63,6 +64,14 @@ class Manager
*/
public static function getAvailableViewDataTables()
{
+ $cache = Cache::getTransientCache();
+ $cacheId = 'ViewDataTable.getAvailableViewDataTables';
+ $dataTables = $cache->fetch($cacheId);
+
+ if (!empty($dataTables)) {
+ return $dataTables;
+ }
+
$klassToExtend = '\\Piwik\\Plugin\\ViewDataTable';
/** @var string[] $visualizations */
@@ -107,6 +116,8 @@ class Manager
$result[$vizId] = $viz;
}
+ $cache->save($cacheId, $result);
+
return $result;
}