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:
authorThomas Steur <thomas.steur@googlemail.com>2014-06-25 08:30:50 +0400
committerThomas Steur <thomas.steur@googlemail.com>2014-06-25 08:30:50 +0400
commitc7f06bb82097db89b746de503c224011a8c7f0a8 (patch)
treec2f4118978a58ecc9a87f7633830971427877bd2 /plugins/Actions/Columns
parent6526e28b143192611cabfcba4e0d8d5cd92464ad (diff)
started to handle changes to dimensions, for instance if a new dimension is added the platform should detect this and run an update script. also if a dimension suddenly handles new cases such as conversion it should automatically add a column to log_conversion after a user confirms. Have not tested update and/or installation yet
Diffstat (limited to 'plugins/Actions/Columns')
-rw-r--r--plugins/Actions/Columns/EntryPageTitle.php4
-rw-r--r--plugins/Actions/Columns/EntryPageUrl.php4
-rw-r--r--plugins/Actions/Columns/ExitPageTitle.php4
-rw-r--r--plugins/Actions/Columns/ExitPageUrl.php4
-rw-r--r--plugins/Actions/Columns/PageTitle.php4
-rw-r--r--plugins/Actions/Columns/PageUrl.php4
-rw-r--r--plugins/Actions/Columns/ServerTime.php18
-rw-r--r--plugins/Actions/Columns/TimeSpentRefAction.php4
-rw-r--r--plugins/Actions/Columns/VisitTotalActions.php4
-rw-r--r--plugins/Actions/Columns/VisitTotalSearches.php4
10 files changed, 30 insertions, 24 deletions
diff --git a/plugins/Actions/Columns/EntryPageTitle.php b/plugins/Actions/Columns/EntryPageTitle.php
index 8b341a1c4f..7d67002a8f 100644
--- a/plugins/Actions/Columns/EntryPageTitle.php
+++ b/plugins/Actions/Columns/EntryPageTitle.php
@@ -17,8 +17,8 @@ use Piwik\Tracker\Visitor;
class EntryPageTitle extends VisitDimension
{
- protected $fieldName = 'visit_entry_idaction_name';
- protected $fieldType = 'INTEGER(11) UNSIGNED NOT NULL';
+ protected $columnName = 'visit_entry_idaction_name';
+ protected $columnType = 'INTEGER(11) UNSIGNED NOT NULL';
protected function configureSegments()
{
diff --git a/plugins/Actions/Columns/EntryPageUrl.php b/plugins/Actions/Columns/EntryPageUrl.php
index 96acc84d28..a5d20a3859 100644
--- a/plugins/Actions/Columns/EntryPageUrl.php
+++ b/plugins/Actions/Columns/EntryPageUrl.php
@@ -17,8 +17,8 @@ use Piwik\Tracker\Visitor;
class EntryPageUrl extends VisitDimension
{
- protected $fieldName = 'visit_entry_idaction_url';
- protected $fieldType = 'INTEGER(11) UNSIGNED NOT NULL';
+ protected $columnName = 'visit_entry_idaction_url';
+ protected $columnType = 'INTEGER(11) UNSIGNED NOT NULL';
protected function configureSegments()
{
diff --git a/plugins/Actions/Columns/ExitPageTitle.php b/plugins/Actions/Columns/ExitPageTitle.php
index 71aaeed897..6a1f2948aa 100644
--- a/plugins/Actions/Columns/ExitPageTitle.php
+++ b/plugins/Actions/Columns/ExitPageTitle.php
@@ -17,8 +17,8 @@ use Piwik\Tracker\Visitor;
class ExitPageTitle extends VisitDimension
{
- protected $fieldName = 'visit_exit_idaction_name';
- protected $fieldType = 'INTEGER(11) UNSIGNED NOT NULL';
+ protected $columnName = 'visit_exit_idaction_name';
+ protected $columnType = 'INTEGER(11) UNSIGNED NOT NULL';
protected function configureSegments()
{
diff --git a/plugins/Actions/Columns/ExitPageUrl.php b/plugins/Actions/Columns/ExitPageUrl.php
index b22246039c..dc83358ce1 100644
--- a/plugins/Actions/Columns/ExitPageUrl.php
+++ b/plugins/Actions/Columns/ExitPageUrl.php
@@ -17,8 +17,8 @@ use Piwik\Tracker\Visitor;
class ExitPageUrl extends VisitDimension
{
- protected $fieldName = 'visit_exit_idaction_url';
- protected $fieldType = 'INTEGER(11) UNSIGNED NULL DEFAULT 0';
+ protected $columnName = 'visit_exit_idaction_url';
+ protected $columnType = 'INTEGER(11) UNSIGNED NULL DEFAULT 0';
protected function configureSegments()
{
diff --git a/plugins/Actions/Columns/PageTitle.php b/plugins/Actions/Columns/PageTitle.php
index 94f3b09dd6..5dbbecdac6 100644
--- a/plugins/Actions/Columns/PageTitle.php
+++ b/plugins/Actions/Columns/PageTitle.php
@@ -15,8 +15,8 @@ use Piwik\Tracker\Request;
class PageTitle extends ActionDimension
{
- protected $fieldName = 'idaction_name';
- protected $fieldType = 'INTEGER(10) UNSIGNED';
+ protected $columnName = 'idaction_name';
+ protected $columnType = 'INTEGER(10) UNSIGNED';
protected function configureSegments()
{
diff --git a/plugins/Actions/Columns/PageUrl.php b/plugins/Actions/Columns/PageUrl.php
index e36a3db163..c6c149ee61 100644
--- a/plugins/Actions/Columns/PageUrl.php
+++ b/plugins/Actions/Columns/PageUrl.php
@@ -14,8 +14,8 @@ use Piwik\Plugins\Actions\Segment;
class PageUrl extends ActionDimension
{
- protected $fieldName = 'idaction_url';
- protected $fieldType = 'INTEGER(10) UNSIGNED DEFAULT NULL';
+ protected $columnName = 'idaction_url';
+ protected $columnType = 'INTEGER(10) UNSIGNED DEFAULT NULL';
protected function configureSegments()
{
diff --git a/plugins/Actions/Columns/ServerTime.php b/plugins/Actions/Columns/ServerTime.php
index c32705a3eb..4273d553e5 100644
--- a/plugins/Actions/Columns/ServerTime.php
+++ b/plugins/Actions/Columns/ServerTime.php
@@ -18,15 +18,21 @@ use Piwik\Tracker;
class ServerTime extends ActionDimension
{
- protected $fieldName = 'server_time';
- protected $fieldType = 'DATETIME NOT NULL';
+ protected $columnName = 'server_time';
+ protected $columnType = 'DATETIME NOT NULL';
- public function install()
+ public function install($actionColumns)
{
- parent::install();
+ if (in_array($this->columnName, $actionColumns)) {
+ return;
+ }
- $sql = "ALTER TABLE `" . Common::prefixTable("log_link_visit_action") . "` ADD INDEX index_idsite_servertime ( idsite, server_time )";
- Db::exec($sql);
+ return array(
+ Common::prefixTable("log_link_visit_action") => array(
+ "ADD COLUMN server_time DATETIME NOT NULL",
+ "ADD INDEX index_idsite_servertime ( idsite, server_time )"
+ )
+ );
}
public function getName()
diff --git a/plugins/Actions/Columns/TimeSpentRefAction.php b/plugins/Actions/Columns/TimeSpentRefAction.php
index a65067ca68..10485e1fb8 100644
--- a/plugins/Actions/Columns/TimeSpentRefAction.php
+++ b/plugins/Actions/Columns/TimeSpentRefAction.php
@@ -15,8 +15,8 @@ use Piwik\Tracker\Visitor;
class TimeSpentRefAction extends ActionDimension
{
- protected $fieldName = 'time_spent_ref_action';
- protected $fieldType = 'INTEGER(10) UNSIGNED NOT NULL';
+ protected $columnName = 'time_spent_ref_action';
+ protected $columnType = 'INTEGER(10) UNSIGNED NOT NULL';
public function getName()
{
diff --git a/plugins/Actions/Columns/VisitTotalActions.php b/plugins/Actions/Columns/VisitTotalActions.php
index 0520160174..37f8acfba2 100644
--- a/plugins/Actions/Columns/VisitTotalActions.php
+++ b/plugins/Actions/Columns/VisitTotalActions.php
@@ -17,8 +17,8 @@ use Piwik\Tracker\Visitor;
class VisitTotalActions extends VisitDimension
{
- protected $fieldName = 'visit_total_actions';
- protected $fieldType = 'SMALLINT(5) UNSIGNED NOT NULL';
+ protected $columnName = 'visit_total_actions';
+ protected $columnType = 'SMALLINT(5) UNSIGNED NOT NULL';
protected function configureSegments()
{
diff --git a/plugins/Actions/Columns/VisitTotalSearches.php b/plugins/Actions/Columns/VisitTotalSearches.php
index 059f4a512a..47eec61b1e 100644
--- a/plugins/Actions/Columns/VisitTotalSearches.php
+++ b/plugins/Actions/Columns/VisitTotalSearches.php
@@ -17,8 +17,8 @@ use Piwik\Tracker\Visitor;
class VisitTotalSearches extends VisitDimension
{
- protected $fieldName = 'visit_total_searches';
- protected $fieldType = 'SMALLINT(5) UNSIGNED NOT NULL';
+ protected $columnName = 'visit_total_searches';
+ protected $columnType = 'SMALLINT(5) UNSIGNED NOT NULL';
protected function configureSegments()
{