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:
authormatthieu_ <matthieu_@59fd770c-687e-43c8-a1e3-f5a4ff64c105>2007-08-17 22:08:14 +0400
committermatthieu_ <matthieu_@59fd770c-687e-43c8-a1e3-f5a4ff64c105>2007-08-17 22:08:14 +0400
commit00f5a744883fc3a5ce0706714d98fd9b86a7f51e (patch)
tree82fb3dc171acb7093e8b9eadab6e1d9cb013d66c /modules/LogStats
parent49c593b1cc964373c1a2567a7e03154c166639fc (diff)
Implemented half of the PERIOD archiving
still have to implement the DataTable::addDataTable( ) for recursive table
Diffstat (limited to 'modules/LogStats')
-rw-r--r--modules/LogStats/Generator.php18
-rw-r--r--modules/LogStats/Visit.php5
2 files changed, 18 insertions, 5 deletions
diff --git a/modules/LogStats/Generator.php b/modules/LogStats/Generator.php
index c540ac530a..e2ffb7e175 100644
--- a/modules/LogStats/Generator.php
+++ b/modules/LogStats/Generator.php
@@ -32,6 +32,7 @@ class Piwik_LogStats_Generator
public $reinitProfilingAtEveryRequest = true;
public $host = 'http://localhost';
+ protected $timestampToUse;
public function __construct()
{
@@ -48,6 +49,16 @@ class Piwik_LogStats_Generator
$this->profiling = true;
Piwik_LogStats_Db::enableProfiling();
+ $this->timestampToUse = time();
+ }
+
+ public function setTimestampToUse($timestamp)
+ {
+ $this->timestampToUse = $timestamp;
+ }
+ public function getTimestampToUse()
+ {
+ return $this->timestampToUse;
}
public function addParam( $name, $aValue)
{
@@ -182,6 +193,8 @@ class Piwik_LogStats_Generator
// print("$i ");
$nbActions = mt_rand(1, $nbActionsMaxPerVisit);
+ Piwik_LogStats_Generator_Visit::setTimestampToUse($this->getTimestampToUse());
+
$this->generateNewVisit();
for($j = 1; $j <= $nbActions; $j++)
{
@@ -308,7 +321,7 @@ class Piwik_LogStats_Generator
$len = mt_rand($minLength, $maxLength);
// Register the lower case alphabet array
- $alpha = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm');
+ $alpha = array('a', 'b', 'c', 'd', 'e', 'f', 'g');
// Register the upper case alphabet array
$ALPHA = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
@@ -427,8 +440,7 @@ class Piwik_LogStats_Generator_Visit extends Piwik_LogStats_Visit
}
protected function getCurrentDate( $format = "Y-m-d")
{
- if($format == "Y-m-d") return date($format);
- else return date($format, $this->getCurrentTimestamp() );
+ return date($format, $this->getCurrentTimestamp() );
}
protected function getCurrentTimestamp()
diff --git a/modules/LogStats/Visit.php b/modules/LogStats/Visit.php
index 2b801ebb82..d42faee6d4 100644
--- a/modules/LogStats/Visit.php
+++ b/modules/LogStats/Visit.php
@@ -398,8 +398,9 @@ class Piwik_LogStats_Visit
$localTime = Piwik_Common::getRequestVar( 'h', $this->getCurrentDate("H"), 'numeric')
.':'. Piwik_Common::getRequestVar( 'm', $this->getCurrentDate("i"), 'numeric')
.':'. Piwik_Common::getRequestVar( 's', $this->getCurrentDate("s"), 'numeric');
- $serverDate = $this->getCurrentDate();
- $serverTime = $this->getCurrentTimestamp();
+
+ $serverTime = $this->getCurrentTimestamp();
+ $serverDate = $this->getCurrentDate();
if($this->isVisitorKnown())
{