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:
Diffstat (limited to 'modules/ArchiveProcessing.php')
-rw-r--r--modules/ArchiveProcessing.php222
1 files changed, 111 insertions, 111 deletions
diff --git a/modules/ArchiveProcessing.php b/modules/ArchiveProcessing.php
index 402b99b43f..9c2204c19d 100644
--- a/modules/ArchiveProcessing.php
+++ b/modules/ArchiveProcessing.php
@@ -1,18 +1,18 @@
-<?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_ArchiveProcessing
- */
-
-require_once 'TablePartitioning.php';
-require_once 'ArchiveProcessing/Record.php';
+<?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_ArchiveProcessing
+ */
+
+require_once 'TablePartitioning.php';
+require_once 'ArchiveProcessing/Record.php';
require_once 'DataTable.php';
-
+
/**
* The ArchiveProcessing module is a module that reads the Piwik logs from the DB and
* compute all the reports, which are then stored in the database.
@@ -67,34 +67,34 @@ abstract class Piwik_ArchiveProcessing
* Timestamp for the first date of the period
*
* @var int unix timestamp
- */
- protected $timestampDateStart = null;
-
+ */
+ protected $timestampDateStart = null;
+
/**
* Starting date of the archive
- *
- * @var Piwik_Date
+ *
+ * @var Piwik_Date
*/
- protected $dateStart;
+ protected $dateStart;
/**
* Ending date of the archive
- *
- * @var Piwik_Date
+ *
+ * @var Piwik_Date
*/
- protected $dateEnd;
-
+ protected $dateEnd;
+
/**
* Object used to generate (depending on the $dateStart) the name of the DB table to use to store numeric values
- *
- * @var Piwik_TablePartitioning
+ *
+ * @var Piwik_TablePartitioning
*/
- protected $tableArchiveNumeric;
+ protected $tableArchiveNumeric;
/**
* Object used to generate (depending on the $dateStart) the name of the DB table to use to store numeric values
- *
- * @var Piwik_TablePartitioning
+ *
+ * @var Piwik_TablePartitioning
*/
- protected $tableArchiveBlob;
+ protected $tableArchiveBlob;
/**
* Maximum timestamp above which a given archive is considered out of date
@@ -109,25 +109,25 @@ abstract class Piwik_ArchiveProcessing
*
* @var int
*/
- public $idsite = null;
+ public $idsite = null;
/**
* Period of the current archive
* Can be accessed by plugins (that is why it's public)
*
- * @var Piwik_Period
+ * @var Piwik_Period
*/
- public $period = null;
-
+ public $period = null;
+
/**
* Site of the current archive
* Can be accessed by plugins (that is why it's public)
- *
- * @var Piwik_Site
+ *
+ * @var Piwik_Site
*/
public $site = null;
-
-
+
+
/**
* Starting date @see Piwik_Date::toString()
*
@@ -179,42 +179,42 @@ abstract class Piwik_ArchiveProcessing
public function __construct()
{
$this->debugAlwaysArchive = Zend_Registry::get('config')->Debug->always_archive_data;
- }
-
-
- /**
- * Returns the Piwik_ArchiveProcessing_Day or Piwik_ArchiveProcessing_Period object
- * depending on $name period string
- *
- * @param string $name day|week|month|year
- * @return Piwik_ArchiveProcessing Piwik_ArchiveProcessing_Day|Piwik_ArchiveProcessing_Period
- */
- static function factory($name )
- {
- switch($name)
- {
- case 'day':
- require_once 'ArchiveProcessing/Day.php';
- $process = new Piwik_ArchiveProcessing_Day;
- break;
-
- case 'week':
- case 'month':
- case 'year':
- require_once 'ArchiveProcessing/Period.php';
- $process = new Piwik_ArchiveProcessing_Period;
- break;
-
- default:
- throw new Exception("Unknown period specified $name");
- break;
- }
- return $process;
- }
-
- /**
- * Inits the object
- *
+ }
+
+
+ /**
+ * Returns the Piwik_ArchiveProcessing_Day or Piwik_ArchiveProcessing_Period object
+ * depending on $name period string
+ *
+ * @param string $name day|week|month|year
+ * @return Piwik_ArchiveProcessing Piwik_ArchiveProcessing_Day|Piwik_ArchiveProcessing_Period
+ */
+ static function factory($name )
+ {
+ switch($name)
+ {
+ case 'day':
+ require_once 'ArchiveProcessing/Day.php';
+ $process = new Piwik_ArchiveProcessing_Day;
+ break;
+
+ case 'week':
+ case 'month':
+ case 'year':
+ require_once 'ArchiveProcessing/Period.php';
+ $process = new Piwik_ArchiveProcessing_Period;
+ break;
+
+ default:
+ throw new Exception("Unknown period specified $name");
+ break;
+ }
+ return $process;
+ }
+
+ /**
+ * Inits the object
+ *
* @return void
*/
protected function loadArchiveProperties()
@@ -233,8 +233,8 @@ abstract class Piwik_ArchiveProcessing
$this->strDateStart = $this->dateStart->toString();
$this->strDateEnd = $this->dateEnd->toString();
-
- // if the current archive is a DAY and if it's today,
+
+ // if the current archive is a DAY and if it's today,
// we set this maxTimestampArchive that defines the lifetime value of today's archive
$this->maxTimestampArchive = 0;
if( $this->period->getNumberOfSubperiods() == 0
@@ -371,20 +371,20 @@ abstract class Piwik_ArchiveProcessing
}
- /**
- * Returns the name of the numeric table where the archive numeric values are stored
- *
- * @return string
+ /**
+ * Returns the name of the numeric table where the archive numeric values are stored
+ *
+ * @return string
*/
public function getTableArchiveNumericName()
{
return $this->tableArchiveNumeric->getTableName();
}
-
- /**
- * Returns the name of the blob table where the archive blob values are stored
- *
- * @return string
+
+ /**
+ * Returns the name of the blob table where the archive blob values are stored
+ *
+ * @return string
*/
public function getTableArchiveBlobName()
{
@@ -392,20 +392,20 @@ abstract class Piwik_ArchiveProcessing
}
- /**
- * Set the period
- *
- * @param Piwik_Period $period
+ /**
+ * Set the period
+ *
+ * @param Piwik_Period $period
*/
public function setPeriod( Piwik_Period $period )
{
$this->period = $period;
}
- /**
- * Set the site
- *
- * @param Piwik_Site $site
+ /**
+ * Set the site
+ *
+ * @param Piwik_Site $site
*/
public function setSite( Piwik_Site $site )
{
@@ -427,10 +427,10 @@ abstract class Piwik_ArchiveProcessing
return $this->timestampDateStart;
}
- /**
- * Returns the idArchive we will use for the current archive
- *
- * @return int IdArchive to use when saving the current Archive
+ /**
+ * Returns the idArchive we will use for the current archive
+ *
+ * @return int IdArchive to use when saving the current Archive
*/
protected function loadNextIdarchive()
{
@@ -442,12 +442,12 @@ abstract class Piwik_ArchiveProcessing
}
$this->idArchive = $id + 1;
- }
-
- /**
- * Inserts a record in the good table (either NUMERIC or BLOB)
- *
- * @param unknown_type $record
+ }
+
+ /**
+ * Inserts a record in the good table (either NUMERIC or BLOB)
+ *
+ * @param unknown_type $record
*/
protected function insertRecord($record)
{
@@ -477,8 +477,8 @@ abstract class Piwik_ArchiveProcessing
}
/**
- * Returns the ID of the archived subperiods.
- *
+ * Returns the ID of the archived subperiods.
+ *
* @return array Array of the idArchive of the subperiods
*/
protected function loadSubperiodsArchive()
@@ -498,17 +498,17 @@ abstract class Piwik_ArchiveProcessing
return $periods;
}
-
- /**
- * Returns the idArchive if the archive is available in the database.
+
+ /**
+ * Returns the idArchive if the archive is available in the database.
* Returns false if the archive needs to be computed.
*
* An archive is available if
* - for today, the archive was computed less than maxTimestampArchive seconds ago
* - for any other day, if the archive was computed once this day was finished
- * - for other periods, if the archive was computed once the period was finished
- *
- * @return int|false
+ * - for other periods, if the archive was computed once the period was finished
+ *
+ * @return int|false
*/
protected function isArchived()
{