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:
authorsgiehl <stefan@piwik.org>2014-04-03 16:45:54 +0400
committersgiehl <stefan@piwik.org>2014-04-03 16:45:54 +0400
commite380ce2246173ab0dda603dc2eb515711ea2e34b (patch)
tree93e92fc7ed566053cda375974de74cdba4744360 /core/Tracker
parent7a98becbec6bf32038549c879b4f6cfda3a7b77d (diff)
parent644b63fd6035fd8d0b113e8ce71629af0378e738 (diff)
Merge branch 'master' into DeviceDetectorIntegration
Diffstat (limited to 'core/Tracker')
-rw-r--r--core/Tracker/Action.php3
-rw-r--r--core/Tracker/GoalManager.php10
-rw-r--r--core/Tracker/Request.php6
-rw-r--r--core/Tracker/Visit.php15
4 files changed, 18 insertions, 16 deletions
diff --git a/core/Tracker/Action.php b/core/Tracker/Action.php
index aa940151d7..a1d879b52e 100644
--- a/core/Tracker/Action.php
+++ b/core/Tracker/Action.php
@@ -190,9 +190,6 @@ abstract class Action
public function writeDebugInfo()
{
- if (!isset($GLOBALS['PIWIK_TRACKER_DEBUG']) || !$GLOBALS['PIWIK_TRACKER_DEBUG']) {
- return false;
- }
$type = self::getTypeAsString($this->getActionType());
Common::printDebug("Action is a $type,
Action name = " . $this->getActionName() . ",
diff --git a/core/Tracker/GoalManager.php b/core/Tracker/GoalManager.php
index 939565e7fe..daa88bd7b9 100644
--- a/core/Tracker/GoalManager.php
+++ b/core/Tracker/GoalManager.php
@@ -11,8 +11,8 @@ namespace Piwik\Tracker;
use Exception;
use Piwik\Common;
use Piwik\Config;
-use Piwik\Log;
use Piwik\Piwik;
+use Piwik\Plugins\CustomVariables\CustomVariables;
use Piwik\Tracker;
/**
@@ -227,7 +227,11 @@ class GoalManager
}
// Copy Custom Variables from Visit row to the Goal conversion
- for ($i = 1; $i <= Tracker::MAX_CUSTOM_VARIABLES; $i++) {
+ // Otherwise, set the Custom Variables found in the cookie sent with this request
+ $goal += $visitCustomVariables;
+ $maxCustomVariables = CustomVariables::getMaxCustomVariables();
+
+ for ($i = 1; $i <= $maxCustomVariables; $i++) {
if (isset($visitorInformation['custom_var_k' . $i])
&& strlen($visitorInformation['custom_var_k' . $i])
) {
@@ -239,8 +243,6 @@ class GoalManager
$goal['custom_var_v' . $i] = $visitorInformation['custom_var_v' . $i];
}
}
- // Otherwise, set the Custom Variables found in the cookie sent with this request
- $goal += $visitCustomVariables;
// Attributing the correct Referrer to this conversion.
// Priority order is as follows:
diff --git a/core/Tracker/Request.php b/core/Tracker/Request.php
index 3dbe3f98d8..df551e7d82 100644
--- a/core/Tracker/Request.php
+++ b/core/Tracker/Request.php
@@ -14,6 +14,7 @@ use Piwik\Config;
use Piwik\Cookie;
use Piwik\IP;
use Piwik\Piwik;
+use Piwik\Plugins\CustomVariables\CustomVariables;
use Piwik\Registry;
use Piwik\Tracker;
@@ -352,10 +353,11 @@ class Request
return array();
}
$customVariables = array();
+ $maxCustomVars = CustomVariables::getMaxCustomVariables();
foreach ($customVar as $id => $keyValue) {
$id = (int)$id;
if ($id < 1
- || $id > Tracker::MAX_CUSTOM_VARIABLES
+ || $id > $maxCustomVars
|| count($keyValue) != 2
|| (!is_string($keyValue[0]) && !is_numeric($keyValue[0]))
) {
@@ -379,7 +381,7 @@ class Request
public static function truncateCustomVariable($input)
{
- return substr(trim($input), 0, Tracker::MAX_LENGTH_CUSTOM_VARIABLE);
+ return substr(trim($input), 0, CustomVariables::getMaxLengthCustomVariables());
}
protected function shouldUseThirdPartyCookie()
diff --git a/core/Tracker/Visit.php b/core/Tracker/Visit.php
index cfca27271a..fecab8125e 100644
--- a/core/Tracker/Visit.php
+++ b/core/Tracker/Visit.php
@@ -13,6 +13,7 @@ use Piwik\Common;
use Piwik\Config;
use Piwik\IP;
use Piwik\Piwik;
+use Piwik\Plugins\CustomVariables\CustomVariables;
use Piwik\Tracker;
use DeviceDetector;
@@ -396,12 +397,11 @@ class Visit implements VisitInterface
$selectCustomVariables = '';
// No custom var were found in the request, so let's copy the previous one in a potential conversion later
if (!$this->visitorCustomVariables) {
- $selectCustomVariables = ',
- custom_var_k1, custom_var_v1,
- custom_var_k2, custom_var_v2,
- custom_var_k3, custom_var_v3,
- custom_var_k4, custom_var_v4,
- custom_var_k5, custom_var_v5';
+ $maxCustomVariables = CustomVariables::getMaxCustomVariables();
+
+ for ($index = 1; $index <= $maxCustomVariables; $index++) {
+ $selectCustomVariables .= ', custom_var_k' . $index . ', custom_var_v' . $index;
+ }
}
$persistedVisitAttributes = $this->getVisitFieldsPersist();
@@ -513,7 +513,8 @@ class Visit implements VisitInterface
// Custom Variables copied from Visit in potential later conversion
if (!empty($selectCustomVariables)) {
- for ($i = 1; $i <= Tracker::MAX_CUSTOM_VARIABLES; $i++) {
+ $maxCustomVariables = CustomVariables::getMaxCustomVariables();
+ for ($i = 1; $i <= $maxCustomVariables; $i++) {
if (isset($visitRow['custom_var_k' . $i])
&& strlen($visitRow['custom_var_k' . $i])
) {