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-07-31 10:11:10 +0300
committerThomas Steur <thomas.steur@gmail.com>2015-07-31 10:11:10 +0300
commit35c5cb9b94461e28209ae13851963c7633a10f82 (patch)
treea21af25d01f1ca7833e414168247ab39c4bb406f /core/DataAccess
parent28fe0f20c1f54b75ca6e44a6a8672212344c87bf (diff)
the requested plugin is not the plugin that triggers the query, we need to set it each time
Diffstat (limited to 'core/DataAccess')
-rw-r--r--core/DataAccess/LogAggregator.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/core/DataAccess/LogAggregator.php b/core/DataAccess/LogAggregator.php
index 06d4b350d7..ceeba0b156 100644
--- a/core/DataAccess/LogAggregator.php
+++ b/core/DataAccess/LogAggregator.php
@@ -138,7 +138,7 @@ class LogAggregator
/**
* @var string
*/
- private $requestedPlugin;
+ private $queryOriginHint = '';
/**
* Constructor.
@@ -151,7 +151,11 @@ class LogAggregator
$this->dateEnd = $params->getDateEnd();
$this->segment = $params->getSegment();
$this->sites = $params->getIdSites();
- $this->requestedPlugin = $params->getRequestedPlugin();
+ }
+
+ public function setQueryOriginHint($nameOfOrigiin)
+ {
+ $this->queryOriginHint = $nameOfOrigiin;
}
public function generateQuery($select, $from, $where, $groupBy, $orderBy)
@@ -160,9 +164,9 @@ class LogAggregator
$query = $this->segment->getSelectQuery($select, $from, $where, $bind, $orderBy, $groupBy);
$select = 'SELECT';
- if ($this->requestedPlugin && is_array($query) && 0 === strpos(trim($query['sql']), $select)) {
+ if ($this->queryOriginHint && is_array($query) && 0 === strpos(trim($query['sql']), $select)) {
$query['sql'] = trim($query['sql']);
- $query['sql'] = 'SELECT /* ' . $this->requestedPlugin . ' */' . substr($query['sql'], strlen($select));
+ $query['sql'] = 'SELECT /* ' . $this->queryOriginHint . ' */' . substr($query['sql'], strlen($select));
}
return $query;