blob: 9d6f8c60432d776ccaacf3a797eddd007af0f5ec (
plain)
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
|
<?php
/**
* Piwik - Open source web analytics
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
* @version $Id$
*
* @package Piwik_Tracker
*/
/**
* Fake Piwik_Tracker_Visit class that overwrite all the Time related method to be able
* to setup a given timestamp for the generated visitor and actions.
*
*
* @package Piwik_Tracker
* @subpackage Piwik_Tracker_Generator
*/
class Piwik_Tracker_Generator_Visit extends Piwik_Tracker_Visit
{
static protected $timestampToUse;
static public function setTimestampToUse($time)
{
self::$timestampToUse = $time;
}
protected function getCurrentDate( $format = "Y-m-d")
{
return date($format, $this->getCurrentTimestamp() );
}
protected function getCurrentTimestamp()
{
self::$timestampToUse = max(@$this->visitorInfo['visit_last_action_time'],self::$timestampToUse);
self::$timestampToUse += mt_rand(4,1840);
return self::$timestampToUse;
}
protected function updateCookie()
{
@parent::updateCookie();
}
}
|