🐘 Action.php (Php) 12.3 KB 2016-05-21
PHP module for Action
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Tracker;
use Exception;
use Piwik\Common;
use Piwik\Piwik;
use Piwik\Plugin\Dimension\ActionDimension;
use Piwik\Plugin\Manager;
use Piwik\Tracker;
/**
* An action
*
*/
abstract class Action
{
const TYPE_PAGE_URL = 1;
const TYPE_OUTLINK = 2;
const TYPE_DOWNLOAD = 3;
const TYPE_PAGE_TITLE = 4;
const TYPE_ECOMMERCE_ITEM_SKU = 5;
const TYPE_ECOMMERCE_ITEM_NAME = 6;
const TYPE_ECOMMERCE_ITEM_CATEGORY = 7;
const TYPE_SITE_SEARCH = 8;
const TYPE_EVENT = 10; // Alias TYPE_EVENT_CATEGORY
const TYPE_EVENT_CATEGORY = 10;
const TYPE_EVENT_ACTION = 11;
const TYPE_EVENT_NAME = 12;
const TYPE_CONTENT = 13; // Alias TYPE_CONTENT_NAME
const TYPE_CONTENT_NAME = 13;
const TYPE_CONTENT_PIECE = 14;
const TYPE_CONTENT_TARGET = 15;
const TYPE_CONTENT_INTERACTION = 16;
const DB_COLUMN_CUSTOM_FLOAT = 'custom_float';
private static $factoryPriority = array(
self::TYPE_PAGE_URL,
self::TYPE_CONTENT,
self::TYPE_SITE_SEARCH,
... [truncated, 395 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "Action.php",
"description": "PHP module for Action",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "12.3 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/Action.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/"
}
🐘 ActionPageview.php (Php) 2.5 KB 2016-05-21
PHP module for ActionPageview
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Tracker;
use Piwik\Config;
/**
* This class represents a page view, tracking URL, page title and generation time.
*
*/
class ActionPageview extends Action
{
protected $timeGeneration = false;
public function __construct(Request $request)
{
parent::__construct(Action::TYPE_PAGE_URL, $request);
$url = $request->getParam('url');
$this->setActionUrl($url);
$actionName = $request->getParam('action_name');
$actionName = $this->cleanupActionName($actionName);
$this->setActionName($actionName);
$this->timeGeneration = $this->request->getPageGenerationTime();
}
protected function getActionsToLookup()
{
return array(
'idaction_name' => array($this->getActionName(), Action::TYPE_PAGE_TITLE),
'idaction_url' => $this->getUrlAndType()
);
}
public function getCustomFloatValue()
{
return $this->request->getPageGenerationTime();
}
public static function shouldHandle(Request $request)
{
... [truncated, 41 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "ActionPageview.php",
"description": "PHP module for ActionPageview",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "2.5 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/ActionPageview.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/"
}
🐘 Cache.php (Php) 6.3 KB 2016-05-21
PHP module for Cache
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Tracker;
use Piwik\Access;
use Piwik\ArchiveProcessor\Rules;
use Piwik\Cache as PiwikCache;
use Piwik\Common;
use Piwik\Config;
use Piwik\Option;
use Piwik\Piwik;
use Piwik\Tracker;
/**
* Simple cache mechanism used in Tracker to avoid requesting settings from mysql on every request
*
*/
class Cache
{
private static $cacheIdGeneral = 'general';
/**
* Public for tests only
* @var \Piwik\Cache\Lazy
*/
public static $cache;
/**
* @return \Piwik\Cache\Lazy
*/
private static function getCache()
{
if (is_null(self::$cache)) {
self::$cache = PiwikCache::getLazyCache();
}
return self::$cache;
}
private static function getTtl()
{
return Config::getInstance()->Tracker['tracker_cache_file_ttl'];
}
... [truncated, 169 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "Cache.php",
"description": "PHP module for Cache",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "6.3 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/Cache.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/"
}
🐘 Db.php (Php) 8.5 KB 2016-05-21
PHP module for Db
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Tracker;
use Exception;
use PDOStatement;
use Piwik\Common;
use Piwik\Config;
use Piwik\Piwik;
use Piwik\Timer;
use Piwik\Tracker;
use Piwik\Tracker\Db\DbException;
use Piwik\Tracker\Db\Mysqli;
use Piwik\Tracker\Db\Pdo\Mysql;
/**
* Simple database wrapper.
* We can't afford to have a dependency with the Zend_Db module in Tracker.
* We wrote this simple class
*
*/
abstract class Db
{
protected static $profiling = false;
protected $queriesProfiling = array();
protected $connection = null;
/**
* Enables the SQL profiling.
* For each query, saves in the DB the time spent on this query.
* Very useful to see the slow query under heavy load.
* You can then use Piwik::displayDbTrackerProfile();
* to display the SQLProfiling report and see which queries take time, etc.
*/
public static function enableProfiling()
{
self::$profiling = true;
}
/**
* Disables the SQL profiling logging.
*/
... [truncated, 244 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "Db.php",
"description": "PHP module for Db",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "8.5 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/Db.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/"
}
🐘 GoalManager.php (Php) 32.0 KB 2016-05-21
PHP module for GoalManager
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Tracker;
use Exception;
use Piwik\Common;
use Piwik\Date;
use Piwik\Piwik;
use Piwik\Plugin\Dimension\ConversionDimension;
use Piwik\Plugin\Dimension\VisitDimension;
use Piwik\Plugins\CustomVariables\CustomVariables;
use Piwik\Tracker;
use Piwik\Tracker\Visit\VisitProperties;
/**
*/
class GoalManager
{
// log_visit.visit_goal_buyer
const TYPE_BUYER_OPEN_CART = 2;
const TYPE_BUYER_ORDERED_AND_OPEN_CART = 3;
// log_conversion.idorder is NULLable, but not log_conversion_item which defaults to zero for carts
const ITEM_IDORDER_ABANDONED_CART = 0;
// log_conversion.idgoal special values
const IDGOAL_CART = -1;
const IDGOAL_ORDER = 0;
const REVENUE_PRECISION = 2;
const MAXIMUM_PRODUCT_CATEGORIES = 5;
// In the GET items parameter, each item has the following array of information
const INDEX_ITEM_SKU = 0;
const INDEX_ITEM_NAME = 1;
const INDEX_ITEM_CATEGORY = 2;
const INDEX_ITEM_PRICE = 3;
const INDEX_ITEM_QUANTITY = 4;
// Used in the array of items, internally to this class
const INTERNAL_ITEM_SKU = 0;
const INTERNAL_ITEM_NAME = 1;
const INTERNAL_ITEM_CATEGORY = 2;
... [truncated, 836 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "GoalManager.php",
"description": "PHP module for GoalManager",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "32.0 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/GoalManager.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/"
}
🐘 Handler.php (Php) 2.7 KB 2016-05-21
PHP module for Handler
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Tracker;
use Piwik\Common;
use Piwik\Exception\InvalidRequestParameterException;
use Piwik\Exception\UnexpectedWebsiteFoundException;
use Piwik\Tracker;
use Exception;
use Piwik\Url;
class Handler
{
/**
* @var Response
*/
private $response;
/**
* @var ScheduledTasksRunner
*/
private $tasksRunner;
public function __construct()
{
$this->setResponse(new Response());
}
public function setResponse($response)
{
$this->response = $response;
}
public function init(Tracker $tracker, RequestSet $requestSet)
{
$this->response->init($tracker);
}
public function process(Tracker $tracker, RequestSet $requestSet)
{
foreach ($requestSet->getRequests() as $request) {
$tracker->trackRequest($request);
}
... [truncated, 68 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "Handler.php",
"description": "PHP module for Handler",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "2.7 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/Handler.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/"
}
🐘 IgnoreCookie.php (Php) 1.7 KB 2016-05-21
PHP module for IgnoreCookie
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Tracker;
use Piwik\Config;
use Piwik\Cookie;
/**
* Tracking cookies.
*
*/
class IgnoreCookie
{
/**
* Get tracking cookie
*
* @return Cookie
*/
public static function getTrackingCookie()
{
$cookie_name = @Config::getInstance()->Tracker['cookie_name'];
$cookie_path = @Config::getInstance()->Tracker['cookie_path'];
return new Cookie($cookie_name, null, $cookie_path);
}
/**
* Get ignore (visit) cookie
*
* @return Cookie
*/
public static function getIgnoreCookie()
{
$cookie_name = @Config::getInstance()->Tracker['ignore_visits_cookie_name'];
$cookie_path = @Config::getInstance()->Tracker['cookie_path'];
return new Cookie($cookie_name, null, $cookie_path);
}
/**
* Set ignore (visit) cookie or deletes it if already present
*/
public static function setIgnoreCookie()
{
... [truncated, 24 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "IgnoreCookie.php",
"description": "PHP module for IgnoreCookie",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "1.7 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/IgnoreCookie.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/"
}
🐘 Model.php (Php) 14.6 KB 2016-05-21
PHP module for Model
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Tracker;
use Exception;
use Piwik\Common;
use Piwik\Tracker;
class Model
{
public function createAction($visitAction)
{
$fields = implode(", ", array_keys($visitAction));
$values = Common::getSqlStringFieldsArray($visitAction);
$table = Common::prefixTable('log_link_visit_action');
$sql = "INSERT INTO $table ($fields) VALUES ($values)";
$bind = array_values($visitAction);
$db = $this->getDb();
$db->query($sql, $bind);
$id = $db->lastInsertId();
return $id;
}
public function createConversion($conversion)
{
$fields = implode(", ", array_keys($conversion));
$bindFields = Common::getSqlStringFieldsArray($conversion);
$table = Common::prefixTable('log_conversion');
$sql = "INSERT IGNORE INTO $table ($fields) VALUES ($bindFields) ";
$bind = array_values($conversion);
$db = $this->getDb();
$result = $db->query($sql, $bind);
// If a record was inserted, we return true
return $db->rowCount($result) > 0;
}
... [truncated, 415 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "Model.php",
"description": "PHP module for Model",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "14.6 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/Model.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/"
}
🐘 PageUrl.php (Php) 12.3 KB 2016-05-21
PHP module for PageUrl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Tracker;
use Piwik\Common;
use Piwik\Config;
use Piwik\Piwik;
use Piwik\UrlHelper;
class PageUrl
{
/**
* Map URL prefixes to integers.
* @see self::normalizeUrl(), self::reconstructNormalizedUrl()
*/
public static $urlPrefixMap = array(
'http://www.' => 1,
'http://' => 0,
'https://www.' => 3,
'https://' => 2
);
/**
* Given the Input URL, will exclude all query parameters set for this site
*
* @static
* @param $originalUrl
* @param $idSite
* @return bool|string Returned URL is HTML entities decoded
*/
public static function excludeQueryParametersFromUrl($originalUrl, $idSite)
{
$originalUrl = self::cleanupUrl($originalUrl);
$parsedUrl = @parse_url($originalUrl);
$parsedUrl = self::cleanupHostAndHashTag($parsedUrl, $idSite);
$parametersToExclude = self::getQueryParametersToExclude($idSite);
if (empty($parsedUrl['query'])) {
if (empty($parsedUrl['fragment'])) {
return UrlHelper::getParseUrlReverse($parsedUrl);
}
... [truncated, 336 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "PageUrl.php",
"description": "PHP module for PageUrl",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "12.3 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/PageUrl.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/"
}
🐘 Request.php (Php) 24.9 KB 2016-05-21
PHP module for Request
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Tracker;
use Exception;
use Piwik\Common;
use Piwik\Config;
use Piwik\Container\StaticContainer;
use Piwik\Cookie;
use Piwik\Exception\InvalidRequestParameterException;
use Piwik\Exception\UnexpectedWebsiteFoundException;
use Piwik\IP;
use Piwik\Network\IPUtils;
use Piwik\Piwik;
use Piwik\Plugins\CustomVariables\CustomVariables;
use Piwik\Tracker;
use Piwik\Cache as PiwikCache;
/**
* The Request object holding the http parameters for this tracking request. Use getParam() to fetch a named parameter.
*
*/
class Request
{
private $cdtCache;
private $idSiteCache;
private $paramsCache = array();
/**
* @var array
*/
protected $params;
protected $rawParams;
protected $isAuthenticated = null;
private $isEmptyRequest = false;
protected $tokenAuth;
/**
* Stores plugin specific tracking request metadata. RequestProcessors can store
* whatever they want in this array, and other RequestProcessors can modify these
* values to change tracker behavior.
*
... [truncated, 777 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "Request.php",
"description": "PHP module for Request",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "24.9 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/Request.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/"
}
🐘 RequestProcessor.php (Php) 7.2 KB 2016-05-21
PHP module for RequestProcessor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
namespace Piwik\Tracker;
use Piwik\Tracker\Visit\VisitProperties;
/**
* Base class for all tracker RequestProcessors. RequestProcessors handle and respond to tracking
* requests.
*
* ## Concept: Request Metadata
*
* RequestProcessors take a Tracker\Request object and based on its information, set request metadata.
*
* Request metadata is information about the current tracking request, for example, whether
* the request is for an existing visit or new visit, or whether the current visitor is a known
* visitor, etc. It is used to control tracking behavior.
*
* Request metadata is shared between RequestProcessors, so RequestProcessors can tweak each others
* behavior, and thus, the behavior of the Tracker. Request metadata can be set and get using the
* {@link Request::setMetadata()} and {@link Request::getMetadata()}
* methods.
*
* Each RequestProcessor lists the request metadata it computes and exposes in its class
* documentation.
*
* ## The Tracking Process
*
* When Piwik handles a single tracking request, it gathers all available RequestProcessors and
* invokes their methods in sequence.
*
* The first method called is {@link self::manipulateRequest()}. By default this is a no-op, but
* RequestProcessors can use it to manipulate tracker requests before they are processed.
*
* The second method called is {@link self::processRequestParams()}. RequestProcessors should use
* this method to compute request metadata and set visit properties using the tracking request.
* An example includes the ActionRequestProcessor, which uses this method to determine the action
* being tracked.
*
* The third method called is {@link self::afterRequestProcessed()}. RequestProcessors should
* use this method to either compute request metadata/visit properties using other plugins'
* request metadata, OR override other plugins' request metadata to tweak tracker behavior.
* An example of the former can be seen in the GoalsRequestProcessor which uses the action
* detected by the ActionsRequestProcessor to see if there are any action-matching goal
... [truncated, 125 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "RequestProcessor.php",
"description": "PHP module for RequestProcessor",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "7.2 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/RequestProcessor.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/"
}
🐘 RequestSet.php (Php) 6.0 KB 2016-05-21
PHP module for RequestSet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Tracker;
use Piwik\Common;
use Piwik\Piwik;
use Piwik\Plugins\SitesManager\SiteUrls;
use Piwik\Url;
class RequestSet
{
/**
* The set of visits to track.
*
* @var Request[]
*/
private $requests = null;
/**
* The token auth supplied with a bulk visits POST.
*
* @var string
*/
private $tokenAuth = null;
private $env = array();
public function setRequests($requests)
{
$this->requests = array();
foreach ($requests as $request) {
if (empty($request) && !is_array($request)) {
continue;
}
if (!$request instanceof Request) {
$request = new Request($request, $this->getTokenAuth());
}
$this->requests[] = $request;
}
}
... [truncated, 206 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "RequestSet.php",
"description": "PHP module for RequestSet",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "6.0 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/RequestSet.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/"
}
🐘 Response.php (Php) 5.5 KB 2016-05-21
PHP module for Response
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Tracker;
use Exception;
use Piwik\Common;
use Piwik\Profiler;
use Piwik\Timer;
use Piwik\Tracker;
use Piwik\Tracker\Db as TrackerDb;
class Response
{
private $timer;
private $content;
public function init(Tracker $tracker)
{
ob_start(); // we use ob_start only because of Common::printDebug, we should actually not really use ob_start
if ($tracker->isDebugModeEnabled()) {
$this->timer = new Timer();
TrackerDb::enableProfiling();
}
}
public function getOutput()
{
$this->outputAccessControlHeaders();
if (is_null($this->content) && ob_get_level() > 0) {
$this->content = ob_get_clean();
}
return $this->content;
}
/**
* Echos an error message & other information, then exits.
*
* @param Tracker $tracker
* @param Exception $e
... [truncated, 133 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "Response.php",
"description": "PHP module for Response",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "5.5 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/Response.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/"
}
🐘 ScheduledTasksRunner.php (Php) 2.9 KB 2016-05-21
PHP module for ScheduledTasksRunner
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Tracker;
use Piwik\CliMulti;
use Piwik\Common;
use Piwik\Option;
use Piwik\Tracker;
class ScheduledTasksRunner
{
public function shouldRun(Tracker $tracker)
{
if (Common::isPhpCliMode()) {
// don't run scheduled tasks in CLI mode from Tracker, this is the case
// where we bulk load logs & don't want to lose time with tasks
return false;
}
return $tracker->shouldRecordStatistics();
}
/**
* Tracker requests will automatically trigger the Scheduled tasks.
* This is useful for users who don't setup the cron,
* but still want daily/weekly/monthly PDF reports emailed automatically.
*
* This is similar to calling the API CoreAdminHome.runScheduledTasks
*/
public function runScheduledTasks()
{
$now = time();
// Currently, there are no hourly tasks. When there are some,
// this could be too aggressive minimum interval (some hours would be skipped in case of low traffic)
$minimumInterval = TrackerConfig::getConfigValue('scheduled_tasks_min_interval');
// If the user disabled browser archiving, he has already setup a cron
// To avoid parallel requests triggering the Scheduled Tasks,
// Get last time tasks started executing
$cache = Cache::getCacheGeneral();
... [truncated, 37 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "ScheduledTasksRunner.php",
"description": "PHP module for ScheduledTasksRunner",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "2.9 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/ScheduledTasksRunner.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/"
}
🐘 Settings.php (Php) 4.2 KB 2016-05-21
Configuration settings for the application
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Tracker;
use Piwik\Config;
use Piwik\Tracker;
use Piwik\DeviceDetectorFactory;
use Piwik\SettingsPiwik;
class Settings // TODO: merge w/ visitor recognizer or make it it's own service. the class name is required for BC.
{
const OS_BOT = 'BOT';
/**
* If `true`, the config ID for a visitor will be the same no matter what site is being tracked.
* If `false, the config ID will be different.
*
* @var bool
*/
private $isSameFingerprintsAcrossWebsites;
public function __construct($isSameFingerprintsAcrossWebsites)
{
$this->isSameFingerprintsAcrossWebsites = $isSameFingerprintsAcrossWebsites;
}
public function getConfigId(Request $request, $ipAddress)
{
list($plugin_Flash, $plugin_Java, $plugin_Director, $plugin_Quicktime, $plugin_RealPlayer, $plugin_PDF,
$plugin_WindowsMedia, $plugin_Gears, $plugin_Silverlight, $plugin_Cookie) = $request->getPlugins();
$userAgent = $request->getUserAgent();
$deviceDetector = DeviceDetectorFactory::getInstance($userAgent);
$aBrowserInfo = $deviceDetector->getClient();
if ($aBrowserInfo['type'] != 'browser') {
// for now only track browsers
unset($aBrowserInfo);
}
$browserName = !empty($aBrowserInfo['short_name']) ? $aBrowserInfo['short_name'] : 'UNK';
$browserVersion = !empty($aBrowserInfo['version']) ? $aBrowserInfo['version'] : '';
... [truncated, 77 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "Settings.php",
"description": "Configuration settings for the application",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "4.2 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/Settings.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/"
}
🐘 SettingsStorage.php (Php) 1.2 KB 2016-05-21
PHP module for SettingsStorage
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Tracker;
use Piwik\Settings\Storage;
use Piwik\Tracker;
use Piwik\Cache as PiwikCache;
/**
* Loads settings from tracker cache instead of database. If not yet present in tracker cache will cache it.
*/
class SettingsStorage extends Storage
{
protected function loadSettings()
{
$cacheId = $this->getOptionKey();
$cache = $this->getCache();
if ($cache->contains($cacheId)) {
$settings = $cache->fetch($cacheId);
} else {
$settings = parent::loadSettings();
$cache->save($cacheId, $settings);
}
return $settings;
}
public function save()
{
parent::save();
self::clearCache();
}
private function getCache()
{
return self::buildCache($this->getOptionKey());
}
public static function clearCache()
{
Cache::deleteTrackerCache();
... [truncated, 9 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "SettingsStorage.php",
"description": "PHP module for SettingsStorage",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "1.2 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/SettingsStorage.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/"
}
🐘 TableLogAction.php (Php) 10.0 KB 2016-05-21
PHP module for TableLogAction
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Tracker;
use Piwik\Common;
use Piwik\Config;
use Piwik\Container\StaticContainer;
use Piwik\Segment\SegmentExpression;
/**
* This class is used to query Action IDs from the log_action table.
*
* A pageview, outlink, download or site search are made of several "Action IDs"
* For example pageview is idaction_url and idaction_name.
*
*/
class TableLogAction
{
/**
* This function will find the idaction from the lookup table piwik_log_action,
* given an Action name, type, and an optional URL Prefix.
*
* This is used to record Page URLs, Page Titles, Ecommerce items SKUs, item names, item categories
*
* If the action name does not exist in the lookup table, it will INSERT it
* @param array $actionsNameAndType Array of one or many (name,type)
* @return array Returns the an array (Field name => idaction)
*/
public static function loadIdsAction($actionsNameAndType)
{
// Add url prefix if not set
foreach ($actionsNameAndType as &$action) {
if (2 == count($action)) {
$action[] = null;
}
}
$actionIds = self::queryIdsAction($actionsNameAndType);
list($queriedIds, $fieldNamesToInsert) = self::processIdsToInsert($actionsNameAndType, $actionIds);
$insertedIds = self::insertNewIdsAction($actionsNameAndType, $fieldNamesToInsert);
$queriedIds = $queriedIds + $insertedIds;
... [truncated, 234 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "TableLogAction.php",
"description": "PHP module for TableLogAction",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "10.0 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/TableLogAction.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/"
}
🐘 TrackerCodeGenerator.php (Php) 8.2 KB 2016-05-21
PHP module for TrackerCodeGenerator
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
namespace Piwik\Tracker;
use Piwik\Common;
use Piwik\Piwik;
use Piwik\Plugins\CustomVariables\CustomVariables;
use Piwik\Plugins\SitesManager\API as APISitesManager;
/**
* Generates the Javascript code to be inserted on every page of the website to track.
*/
class TrackerCodeGenerator
{
/**
* @param int $idSite
* @param string $piwikUrl http://path/to/piwik/site/
* @param bool $mergeSubdomains
* @param bool $groupPageTitlesByDomain
* @param bool $mergeAliasUrls
* @param array $visitorCustomVariables
* @param array $pageCustomVariables
* @param string $customCampaignNameQueryParam
* @param string $customCampaignKeywordParam
* @param bool $doNotTrack
* @param bool $disableCookies
* @return string Javascript code.
*/
public function generate(
$idSite,
$piwikUrl,
$mergeSubdomains = false,
$groupPageTitlesByDomain = false,
$mergeAliasUrls = false,
$visitorCustomVariables = null,
$pageCustomVariables = null,
$customCampaignNameQueryParam = null,
$customCampaignKeywordParam = null,
$doNotTrack = false,
$disableCookies = false
) {
// changes made to this code should be mirrored in plugins/CoreAdminHome/javascripts/jsTrackingGenerator.js var generateJsCode
$jsCode = file_get_contents(PIWIK_INCLUDE_PATH . "/plugins/Morpheus/templates/javascriptCode.tpl");
$jsCode = htmlentities($jsCode);
... [truncated, 150 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "TrackerCodeGenerator.php",
"description": "PHP module for TrackerCodeGenerator",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "8.2 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/TrackerCodeGenerator.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/"
}
🐘 TrackerConfig.php (Php) 791 bytes 2016-05-21
PHP module for TrackerConfig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Tracker;
use Piwik\Config;
use Piwik\Tracker;
class TrackerConfig
{
/**
* Update Tracker config
*
* @param string $name Setting name
* @param mixed $value Value
*/
public static function setConfigValue($name, $value)
{
$section = self::getConfig();
$section[$name] = $value;
Config::getInstance()->Tracker = $section;
}
public static function getConfigValue($name)
{
$config = self::getConfig();
return $config[$name];
}
private static function getConfig()
{
return Config::getInstance()->Tracker;
}
}
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "TrackerConfig.php",
"description": "PHP module for TrackerConfig",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "791 bytes",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/TrackerConfig.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/"
}
🐘 Visit.php (Php) 20.3 KB 2016-05-21
PHP module for Visit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Tracker;
use Piwik\Archive\ArchiveInvalidator;
use Piwik\Common;
use Piwik\Config;
use Piwik\Container\StaticContainer;
use Piwik\Date;
use Piwik\Exception\UnexpectedWebsiteFoundException;
use Piwik\Network\IPUtils;
use Piwik\Piwik;
use Piwik\Plugin;
use Piwik\Plugin\Dimension\VisitDimension;
use Piwik\Tracker;
use Piwik\Tracker\Visit\VisitProperties;
/**
* Class used to handle a Visit.
* A visit is either NEW or KNOWN.
* - If a visit is NEW then we process the visitor information (settings, referrers, etc.) and save
* a new line in the log_visit table.
* - If a visit is KNOWN then we update the visit row in the log_visit table, updating the number of pages
* views, time spent, etc.
*
* Whether a visit is NEW or KNOWN we also save the action in the DB.
* One request to the piwik.php script is associated to one action.
*
*/
class Visit implements VisitInterface
{
const UNKNOWN_CODE = 'xx';
/**
* @var GoalManager
*/
protected $goalManager;
/**
* @var Request
*/
protected $request;
... [truncated, 555 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "Visit.php",
"description": "PHP module for Visit",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "20.3 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/Visit.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/"
}
🐘 VisitExcluded.php (Php) 10.1 KB 2016-05-21
PHP module for VisitExcluded
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Tracker;
use Piwik\Cache as PiwikCache;
use Piwik\Common;
use Piwik\DeviceDetectorFactory;
use Piwik\Network\IP;
use Piwik\Piwik;
use Piwik\Plugins\SitesManager\SiteUrls;
use Piwik\Tracker\Visit\ReferrerSpamFilter;
/**
* This class contains the logic to exclude some visitors from being tracked as per user settings
*/
class VisitExcluded
{
/**
* @var ReferrerSpamFilter
*/
private $spamFilter;
/**
* @param Request $request
* @param bool|string $ip
* @param bool|string $userAgent
*/
public function __construct(Request $request, $ip = false, $userAgent = false)
{
$this->spamFilter = new ReferrerSpamFilter();
if (false === $ip) {
$ip = $request->getIp();
}
if (false === $userAgent) {
$userAgent = $request->getUserAgent();
}
$this->request = $request;
$this->idSite = $request->getIdSite();
$this->userAgent = $userAgent;
$this->ip = $ip;
}
... [truncated, 295 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "VisitExcluded.php",
"description": "PHP module for VisitExcluded",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "10.1 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/VisitExcluded.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/"
}
🐘 VisitInterface.php (Php) 592 bytes 2016-05-21
PHP module for VisitInterface
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Tracker;
/**
* Interface implemented by classes that track visit information for the Tracker.
*
*/
interface VisitInterface
{
/**
* Stores the object describing the current tracking request.
*
* @param Request $request
* @return void
*/
public function setRequest(Request $request);
/**
* Tracks a visit.
*
* @return void
*/
public function handle();
}
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "VisitInterface.php",
"description": "PHP module for VisitInterface",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "592 bytes",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/VisitInterface.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/"
}
🐘 Visitor.php (Php) 1.4 KB 2016-05-21
PHP module for Visitor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Tracker;
use Piwik\Config;
use Piwik\Tracker;
use Piwik\Tracker\Visit\VisitProperties;
class Visitor
{
private $visitorKnown = false;
public $visitProperties;
public function __construct(VisitProperties $visitProperties, $isVisitorKnown = false)
{
$this->visitProperties = $visitProperties;
$this->setIsVisitorKnown($isVisitorKnown);
}
public static function makeFromVisitProperties(VisitProperties $visitProperties, Request $request)
{
$isKnown = $request->getMetadata('CoreHome', 'isVisitorKnown');
return new Visitor($visitProperties, $isKnown);
}
public function setVisitorColumn($column, $value)
{
$this->visitProperties->setProperty($column, $value);
}
public function getVisitorColumn($column)
{
if (array_key_exists($column, $this->visitProperties->getProperties())) {
return $this->visitProperties->getProperty($column);
}
return false;
}
public function isVisitorKnown()
{
return $this->visitorKnown === true;
}
... [truncated, 10 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "Visitor.php",
"description": "PHP module for Visitor",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "1.4 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/Visitor.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/"
}
🐘 VisitorNotFoundInDb.php (Php) 240 bytes 2016-05-21
PHP module for VisitorNotFoundInDb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Tracker;
/**
*/
class VisitorNotFoundInDb extends \Exception
{
}
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "VisitorNotFoundInDb.php",
"description": "PHP module for VisitorNotFoundInDb",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "240 bytes",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/VisitorNotFoundInDb.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/"
}
🐘 VisitorRecognizer.php (Php) 9.6 KB 2016-05-21
PHP module for VisitorRecognizer
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
namespace Piwik\Tracker;
use Piwik\Common;
use Piwik\EventDispatcher;
use Piwik\Plugin\Dimension\VisitDimension;
use Piwik\Plugins\CustomVariables\CustomVariables;
use Piwik\Tracker\Visit\VisitProperties;
/**
* Tracker service that finds the last known visit for the visitor being tracked.
*/
class VisitorRecognizer
{
/**
* Local variable cache for the getVisitFieldsPersist() method.
*
* @var array
*/
private $visitFieldsToSelect;
/**
* See http://piwik.org/faq/how-to/faq_175/.
*
* @var bool
*/
private $trustCookiesOnly;
/**
* Length of a visit in seconds.
*
* @var int
*/
private $visitStandardLength;
/**
* Number of seconds that have to pass after an action before a new action from the same visitor is
* considered a new visit. Defaults to $visitStandardLength.
*
* @var int
*/
private $lookBackNSecondsCustom;
... [truncated, 219 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "VisitorRecognizer.php",
"description": "PHP module for VisitorRecognizer",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "9.6 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/VisitorRecognizer.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/"
}
Db/
(4 files) 🐘 DbException.php (Php) 275 bytes 2016-05-21
PHP module for DbException
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Tracker\Db;
use Exception;
/**
* Database Exception
*
*/
class DbException extends Exception
{
}
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "DbException.php",
"description": "PHP module for DbException",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "275 bytes",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/Db/DbException.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/"
}
🐘 Mysqli.php (Php) 9.3 KB 2016-05-21
PHP module for Mysqli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Tracker\Db;
use Exception;
use Piwik\Tracker\Db;
/**
* mysqli wrapper
*
*/
class Mysqli extends Db
{
protected $connection = null;
protected $host;
protected $port;
protected $socket;
protected $dbname;
protected $username;
protected $password;
protected $charset;
protected $activeTransaction = false;
/**
* Builds the DB object
*
* @param array $dbInfo
* @param string $driverName
*/
public function __construct($dbInfo, $driverName = 'mysql')
{
if (isset($dbInfo['unix_socket']) && $dbInfo['unix_socket'][0] == '/') {
$this->host = null;
$this->port = null;
$this->socket = $dbInfo['unix_socket'];
} elseif ($dbInfo['port'][0] == '/') {
$this->host = null;
$this->port = null;
$this->socket = $dbInfo['port'];
} else {
$this->host = $dbInfo['host'];
$this->port = (int)$dbInfo['port'];
$this->socket = null;
}
... [truncated, 296 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "Mysqli.php",
"description": "PHP module for Mysqli",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "9.3 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/Db/Mysqli.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/"
}
Pdo/
(2 files) 🐘 Mysql.php (Php) 8.4 KB 2016-05-21
PHP module for Mysql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Tracker\Db\Pdo;
use Exception;
use PDO;
use PDOException;
use PDOStatement;
use Piwik\Tracker\Db;
use Piwik\Tracker\Db\DbException;
/**
* PDO MySQL wrapper
*
*/
class Mysql extends Db
{
/**
* @var PDO
*/
protected $connection = null;
protected $dsn;
protected $username;
protected $password;
protected $charset;
protected $activeTransaction = false;
/**
* Builds the DB object
*
* @param array $dbInfo
* @param string $driverName
*/
public function __construct($dbInfo, $driverName = 'mysql')
{
if (isset($dbInfo['unix_socket']) && $dbInfo['unix_socket'][0] == '/') {
$this->dsn = $driverName . ':dbname=' . $dbInfo['dbname'] . ';unix_socket=' . $dbInfo['unix_socket'];
} elseif (!empty($dbInfo['port']) && $dbInfo['port'][0] == '/') {
$this->dsn = $driverName . ':dbname=' . $dbInfo['dbname'] . ';unix_socket=' . $dbInfo['port'];
} else {
$this->dsn = $driverName . ':dbname=' . $dbInfo['dbname'] . ';host=' . $dbInfo['host'] . ';port=' . $dbInfo['port'];
}
... [truncated, 257 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "Mysql.php",
"description": "PHP module for Mysql",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "8.4 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/Db/Pdo/Mysql.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/"
}
🐘 Pgsql.php (Php) 3.1 KB 2016-05-21
PHP module for Pgsql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Tracker\Db\Pdo;
use Exception;
use PDO;
/**
* PDO PostgreSQL wrapper
*
*/
class Pgsql extends Mysql
{
/**
* Builds the DB object
*
* @param array $dbInfo
* @param string $driverName
*/
public function __construct($dbInfo, $driverName = 'pgsql')
{
parent::__construct($dbInfo, $driverName);
}
/**
* Connects to the DB
*
* @throws Exception if there was an error connecting the DB
*/
public function connect()
{
if (self::$profiling) {
$timer = $this->initProfiler();
}
$this->connection = new PDO($this->dsn, $this->username, $this->password, $config = array());
$this->connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
// we may want to setAttribute(PDO::ATTR_TIMEOUT ) to a few seconds (default is 60) in case the DB is locked
// the piwik.php would stay waiting for the database... bad!
// we delete the password from this object "just in case" it could be printed
$this->password = '';
if (!empty($this->charset)) {
... [truncated, 67 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "Pgsql.php",
"description": "PHP module for Pgsql",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "3.1 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/Db/Pdo/Pgsql.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/"
}
Handler/
(1 files) 🐘 Factory.php (Php) 1.3 KB 2016-05-21
PHP module for Factory
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Tracker\Handler;
use Exception;
use Piwik\Piwik;
use Piwik\Tracker\Handler;
class Factory
{
public static function make()
{
$handler = null;
/**
* Triggered before a new **handler tracking object** is created. Subscribers to this
* event can force the use of a custom handler tracking object that extends from
* {@link Piwik\Tracker\Handler} and customize any tracking behavior.
*
* @param \Piwik\Tracker\Handler &$handler Initialized to null, but can be set to
* a new handler object. If it isn't modified
* Piwik uses the default class.
* @ignore This event is not public yet as the Handler API is not really stable yet
*/
Piwik::postEvent('Tracker.newHandler', array(&$handler));
if (is_null($handler)) {
$handler = new Handler();
} elseif (!($handler instanceof Handler)) {
throw new Exception("The Handler object set in the plugin must be an instance of Piwik\\Tracker\\Handler");
}
return $handler;
}
}
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "Factory.php",
"description": "PHP module for Factory",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "1.3 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/Handler/Factory.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/"
}
TableLogAction/
(1 files) 🐘 Cache.php (Php) 4.0 KB 2016-05-21
PHP module for Cache
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Tracker\TableLogAction;
use Piwik\Common;
use Piwik\Config;
use Psr\Log\LoggerInterface;
class Cache
{
/**
* @var bool
*/
public $isEnabled;
/**
* @var int cache lifetime in seconds
*/
protected $lifetime;
/**
* @var LoggerInterface
*/
private $logger;
/**
* @var \Piwik\Cache\Lazy
*/
private $cache;
public function __construct(LoggerInterface $logger, Config $config, \Piwik\Cache\Lazy $cache)
{
$this->isEnabled = (bool)$config->General['enable_segments_subquery_cache'];
$this->limitActionIds = $config->General['segments_subquery_cache_limit'];
$this->lifetime = $config->General['segments_subquery_cache_ttl'];
$this->logger = $logger;
$this->cache = $cache;
}
/**
* @param $valueToMatch
* @param $sql
* @return array|null
... [truncated, 110 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "Cache.php",
"description": "PHP module for Cache",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "4.0 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/TableLogAction/Cache.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/"
}
Visit/
(3 files) 🐘 Factory.php (Php) 1.4 KB 2016-05-21
PHP module for Factory
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Tracker\Visit;
use Piwik\Piwik;
use Piwik\Tracker\Visit;
use Piwik\Tracker\VisitInterface;
use Exception;
class Factory
{
/**
* Returns the Tracker_Visit object.
* This method can be overwritten to use a different Tracker_Visit object
*
* @throws Exception
* @return \Piwik\Tracker\Visit
*/
public static function make()
{
$visit = null;
/**
* Triggered before a new **visit tracking object** is created. Subscribers to this
* event can force the use of a custom visit tracking object that extends from
* {@link Piwik\Tracker\VisitInterface}.
*
* @param \Piwik\Tracker\VisitInterface &$visit Initialized to null, but can be set to
* a new visit object. If it isn't modified
* Piwik uses the default class.
*/
Piwik::postEvent('Tracker.makeNewVisitObject', array(&$visit));
if (!isset($visit)) {
$visit = new Visit();
} elseif (!($visit instanceof VisitInterface)) {
throw new Exception("The Visit object set in the plugin must implement VisitInterface");
}
return $visit;
}
}
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "Factory.php",
"description": "PHP module for Factory",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "1.4 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/Visit/Factory.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/"
}
🐘 ReferrerSpamFilter.php (Php) 2.2 KB 2016-05-21
PHP module for ReferrerSpamFilter
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Tracker\Visit;
use Piwik\Cache;
use Piwik\Common;
use Piwik\Option;
use Piwik\Tracker\Request;
/**
* Filters out tracking requests issued by spammers.
*/
class ReferrerSpamFilter
{
const OPTION_STORAGE_NAME = 'referrer_spam_blacklist';
/**
* @var string[]
*/
private $spammerList;
/**
* Check if the request is from a known spammer host.
*
* @param Request $request
* @return bool
*/
public function isSpam(Request $request)
{
$spammers = $this->getSpammerListFromCache();
$referrerUrl = $request->getParam('urlref');
foreach ($spammers as $spammerHost) {
if (stripos($referrerUrl, $spammerHost) !== false) {
Common::printDebug('Referrer URL is a known spam: ' . $spammerHost);
return true;
}
}
return false;
}
private function getSpammerListFromCache()
{
... [truncated, 38 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "ReferrerSpamFilter.php",
"description": "PHP module for ReferrerSpamFilter",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "2.2 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/Visit/ReferrerSpamFilter.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/"
}
🐘 VisitProperties.php (Php) 1.5 KB 2016-05-21
PHP module for VisitProperties
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | <?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
namespace Piwik\Tracker\Visit;
/**
* Holds temporary data for tracking requests.
*/
class VisitProperties
{
/**
* Information about the current visit. This array holds the column values that will be inserted or updated
* in the `log_visit` table, or the values for the last known visit of the current visitor.
*
* @var array
*/
private $visitInfo = array();
/**
* Returns a visit property, or `null` if none is set.
*
* @param string $name The property name.
* @return mixed
*/
public function getProperty($name)
{
return isset($this->visitInfo[$name]) ? $this->visitInfo[$name] : null;
}
/**
* Returns all visit properties by reference.
*
* @return array
*/
public function &getProperties()
{
return $this->visitInfo;
}
/**
* Sets a visit property.
*
* @param string $name The property name.
* @param mixed $value The property value.
*/
... [truncated, 24 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "VisitProperties.php",
"description": "PHP module for VisitProperties",
"dateModified": "2016-05-21",
"dateCreated": "2025-03-23",
"contentSize": "1.5 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/Visit/VisitProperties.php",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Php"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/buzzerstar/static/core/Tracker/"
}