diff options
author | diosmosis <benaka@piwik.pro> | 2015-07-10 06:44:05 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2015-08-06 17:37:59 +0300 |
commit | df6a92196d292510a0744c4eae3ff861a3136899 (patch) | |
tree | 09a2007553dced98f447c0dd4be1b6f7225fe2f5 /plugins | |
parent | 31b93051749f8e7a2f4f8a7ac0fc52124af525f5 (diff) |
Change RequestProcessor method names and remove need to supply Request to Visitor object.
Diffstat (limited to 'plugins')
4 files changed, 10 insertions, 11 deletions
diff --git a/plugins/Actions/Tracker/ActionsRequestProcessor.php b/plugins/Actions/Tracker/ActionsRequestProcessor.php index 225f09499a..1a0dcb4809 100644 --- a/plugins/Actions/Tracker/ActionsRequestProcessor.php +++ b/plugins/Actions/Tracker/ActionsRequestProcessor.php @@ -30,7 +30,7 @@ class ActionsRequestProcessor extends RequestProcessor $visitProperties->setRequestMetadata('Actions', 'action', $action); } - public function manipulateVisitProperties(VisitProperties $visitProperties, Request $request) + public function afterRequestProcessed(VisitProperties $visitProperties, Request $request) { /** @var Action $action */ $action = $visitProperties->getRequestMetadata('Actions', 'action'); @@ -45,7 +45,7 @@ class ActionsRequestProcessor extends RequestProcessor $visitProperties->setRequestMetadata('Actions', 'idReferrerActionName', @$visitProperties->visitorInfo['visit_exit_idaction_name']); } - public function processRequest(VisitProperties $visitProperties, Request $request) + public function recordLogs(VisitProperties $visitProperties) { /** @var Action $action */ $action = $visitProperties->getRequestMetadata('Actions', 'action'); @@ -61,7 +61,7 @@ class ActionsRequestProcessor extends RequestProcessor $idReferrerActionName = $visitProperties->getRequestMetadata('Actions', 'idReferrerActionName'); } - $visitor = Visitor::makeFromVisitProperties($visitProperties, $request); + $visitor = Visitor::makeFromVisitProperties($visitProperties); $action->record($visitor, $idReferrerActionUrl, $idReferrerActionName); } } diff --git a/plugins/CoreHome/Tracker/VisitRequestProcessor.php b/plugins/CoreHome/Tracker/VisitRequestProcessor.php index f33c899118..e57bc219f8 100644 --- a/plugins/CoreHome/Tracker/VisitRequestProcessor.php +++ b/plugins/CoreHome/Tracker/VisitRequestProcessor.php @@ -61,7 +61,7 @@ class VisitRequestProcessor extends RequestProcessor // the IP is needed by isExcluded() and GoalManager->recordGoals() $visitProperties->visitorInfo['location_ip'] = $request->getIp(); - // TODO: move VisitExcluded logic to here (or break into other request processors) + // TODO: move VisitExcluded logic to here (or move to service class stored in DI) $excluded = new VisitExcluded($request, $visitProperties->visitorInfo['location_ip']); if ($excluded->isExcluded()) { return true; @@ -80,7 +80,7 @@ class VisitRequestProcessor extends RequestProcessor return false; } - public function manipulateVisitProperties(VisitProperties $visitProperties, Request $request) + public function afterRequestProcessed(VisitProperties $visitProperties) { /** * Triggered after visits are tested for exclusion so plugins can modify the IP address @@ -135,7 +135,7 @@ class VisitRequestProcessor extends RequestProcessor return isset($lastActionTime) && false !== $lastActionTime - && ($lastActionTime > ($request->getCurrentTimestamp() - $this->visitStandardLength)); // TODO: move to DI + && ($lastActionTime > ($request->getCurrentTimestamp() - $this->visitStandardLength)); } /** diff --git a/plugins/Goals/Tracker/GoalsRequestProcessor.php b/plugins/Goals/Tracker/GoalsRequestProcessor.php index 5336f4fbb9..686649f629 100644 --- a/plugins/Goals/Tracker/GoalsRequestProcessor.php +++ b/plugins/Goals/Tracker/GoalsRequestProcessor.php @@ -14,7 +14,6 @@ use Piwik\Tracker\GoalManager; use Piwik\Tracker\Request; use Piwik\Tracker\RequestProcessor; use Piwik\Tracker\Visit\VisitProperties; -use Piwik\Tracker\Visitor; /** * TODO @@ -53,7 +52,7 @@ class GoalsRequestProcessor extends RequestProcessor return false; } - public function manipulateVisitProperties(VisitProperties $visitProperties, Request $request) + public function afterRequestProcessed(VisitProperties $visitProperties, Request $request) { $visitsConverted = $visitProperties->getRequestMetadata('Goals', 'visitIsConverted'); // TODO: double check, should this be visitIsConverted or someGoalsConverted? @@ -77,7 +76,7 @@ class GoalsRequestProcessor extends RequestProcessor } } - public function processRequest(VisitProperties $visitProperties, Request $request) + public function recordLogs(VisitProperties $visitProperties) { $isManualGoalConversion = self::$goalManager->isManualGoalConversion(); $requestIsEcommerce = self::$goalManager->requestIsEcommerce; @@ -100,7 +99,7 @@ class GoalsRequestProcessor extends RequestProcessor // record the goals if there were conversions in this request (even if the visit itself was not converted) if ($visitProperties->getRequestMetadata('Goals', 'someGoalsConverted')) { - self::$goalManager->recordGoals($visitProperties, $request); + self::$goalManager->recordGoals($visitProperties); } } } diff --git a/plugins/Heartbeat/Tracker/PingRequestProcessor.php b/plugins/Heartbeat/Tracker/PingRequestProcessor.php index 9e45e0c057..3e4decabf4 100644 --- a/plugins/Heartbeat/Tracker/PingRequestProcessor.php +++ b/plugins/Heartbeat/Tracker/PingRequestProcessor.php @@ -27,7 +27,7 @@ class PingRequestProcessor extends RequestProcessor } } - public function manipulateVisitProperties(VisitProperties $visitProperties, Request $request) + public function afterRequestProcessed(VisitProperties $visitProperties, Request $request) { if ($this->isPingRequest($request)) { $visitProperties->setRequestMetadata('Goals', 'someGoalsConverted', false); |