update Piwik to version 2.16 (fixes #91)
This commit is contained in:
parent
296343bf3b
commit
d885a4baa9
5833 changed files with 418860 additions and 226988 deletions
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* Piwik - Open source web analytics
|
||||
* Piwik - free/libre analytics platform
|
||||
*
|
||||
* @link http://piwik.org
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
||||
|
|
@ -11,8 +11,6 @@ namespace Piwik\Tracker;
|
|||
|
||||
use Piwik\Config;
|
||||
|
||||
use Piwik\Tracker;
|
||||
|
||||
/**
|
||||
* This class represents a page view, tracking URL, page title and generation time.
|
||||
*
|
||||
|
|
@ -21,10 +19,11 @@ class ActionPageview extends Action
|
|||
{
|
||||
protected $timeGeneration = false;
|
||||
|
||||
function __construct($url, Request $request)
|
||||
public function __construct(Request $request)
|
||||
{
|
||||
parent::__construct(Action::TYPE_PAGE_URL, $request);
|
||||
|
||||
$url = $request->getParam('url');
|
||||
$this->setActionUrl($url);
|
||||
|
||||
$actionName = $request->getParam('action_name');
|
||||
|
|
@ -38,34 +37,54 @@ class ActionPageview extends Action
|
|||
{
|
||||
return array(
|
||||
'idaction_name' => array($this->getActionName(), Action::TYPE_PAGE_TITLE),
|
||||
'idaction_url' => $this->getUrlAndType()
|
||||
'idaction_url' => $this->getUrlAndType()
|
||||
);
|
||||
}
|
||||
|
||||
function getCustomFloatValue()
|
||||
public function getCustomFloatValue()
|
||||
{
|
||||
return $this->request->getPageGenerationTime();
|
||||
}
|
||||
|
||||
protected function cleanupActionName($actionName)
|
||||
public static function shouldHandle(Request $request)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
private function cleanupActionName($actionName)
|
||||
{
|
||||
// get the delimiter, by default '/'; BC, we read the old action_category_delimiter first (see #1067)
|
||||
$actionCategoryDelimiter = isset(Config::getInstance()->General['action_category_delimiter'])
|
||||
? Config::getInstance()->General['action_category_delimiter']
|
||||
: Config::getInstance()->General['action_url_category_delimiter'];
|
||||
$actionCategoryDelimiter = $this->getActionCategoryDelimiter();
|
||||
|
||||
// create an array of the categories delimited by the delimiter
|
||||
$split = explode($actionCategoryDelimiter, $actionName);
|
||||
$split = $this->trimEveryCategory($split);
|
||||
$split = $this->removeEmptyCategories($split);
|
||||
|
||||
// trim every category
|
||||
$split = array_map('trim', $split);
|
||||
|
||||
// remove empty categories
|
||||
$split = array_filter($split, 'strlen');
|
||||
|
||||
// rebuild the name from the array of cleaned categories
|
||||
$actionName = implode($actionCategoryDelimiter, $split);
|
||||
return $actionName;
|
||||
return $this->rebuildNameOfCleanedCategories($actionCategoryDelimiter, $split);
|
||||
}
|
||||
|
||||
private function rebuildNameOfCleanedCategories($actionCategoryDelimiter, $split)
|
||||
{
|
||||
return implode($actionCategoryDelimiter, $split);
|
||||
}
|
||||
|
||||
private function removeEmptyCategories($split)
|
||||
{
|
||||
return array_filter($split, 'strlen');
|
||||
}
|
||||
|
||||
private function trimEveryCategory($split)
|
||||
{
|
||||
return array_map('trim', $split);
|
||||
}
|
||||
|
||||
private function getActionCategoryDelimiter()
|
||||
{
|
||||
if (isset(Config::getInstance()->General['action_category_delimiter'])) {
|
||||
return Config::getInstance()->General['action_category_delimiter'];
|
||||
}
|
||||
|
||||
return Config::getInstance()->General['action_url_category_delimiter'];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue