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:
Diffstat (limited to 'plugins/Live/Model.php')
-rw-r--r--plugins/Live/Model.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/Live/Model.php b/plugins/Live/Model.php
index 4ec45dc59a..de2587c96e 100644
--- a/plugins/Live/Model.php
+++ b/plugins/Live/Model.php
@@ -12,6 +12,7 @@ namespace Piwik\Plugins\Live;
use Exception;
use Piwik\API\Request;
use Piwik\Common;
+use Piwik\Container\StaticContainer;
use Piwik\Date;
use Piwik\Db;
use Piwik\Period;
@@ -127,8 +128,10 @@ class Model
list($whereIdSites, $idSites) = $this->getIdSitesWhereClause($idSite, $from);
+ $now = StaticContainer::get('Tests.now') ?: time();
+
$bind = $idSites;
- $bind[] = Date::factory(time() - $lastMinutes * 60)->toString('Y-m-d H:i:s');
+ $bind[] = Date::factory($now - $lastMinutes * 60)->toString('Y-m-d H:i:s');
$where = $whereIdSites . "AND " . $where;