update Piwik to version 2.16 (fixes #91)

This commit is contained in:
oliver 2016-04-10 18:55:57 +02:00
commit 47263617c5
111 changed files with 418860 additions and 226988 deletions

View file

@ -1,6 +1,6 @@
<?php
/**
* Piwik - Open source web analytics
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
@ -18,7 +18,7 @@ use Piwik\Updates;
*/
class Updates_0_2_10 extends Updates
{
static function getSql()
public function getMigrationQueries(Updater $updater)
{
return array(
'CREATE TABLE `' . Common::prefixTable('option') . '` (
@ -26,38 +26,33 @@ class Updates_0_2_10 extends Updates
option_name VARCHAR( 64 ) NOT NULL ,
option_value LONGTEXT NOT NULL ,
PRIMARY KEY ( idoption , option_name )
)' => false,
)' => 1050,
// 0.1.7 [463]
'ALTER IGNORE TABLE `' . Common::prefixTable('log_visit') . '`
CHANGE `location_provider` `location_provider` VARCHAR( 100 ) DEFAULT NULL' => '1054',
'ALTER TABLE `' . Common::prefixTable('log_visit') . '`
CHANGE `location_provider` `location_provider` VARCHAR( 100 ) DEFAULT NULL' => 1054,
// 0.1.7 [470]
'ALTER TABLE `' . Common::prefixTable('logger_api_call') . '`
CHANGE `parameter_names_default_values` `parameter_names_default_values` TEXT,
CHANGE `parameter_values` `parameter_values` TEXT,
CHANGE `returned_value` `returned_value` TEXT' => false,
CHANGE `returned_value` `returned_value` TEXT' => array(1054, 1146),
'ALTER TABLE `' . Common::prefixTable('logger_error') . '`
CHANGE `message` `message` TEXT' => false,
CHANGE `message` `message` TEXT' => array(1054, 1146),
'ALTER TABLE `' . Common::prefixTable('logger_exception') . '`
CHANGE `message` `message` TEXT' => false,
CHANGE `message` `message` TEXT' => array(1054, 1146),
'ALTER TABLE `' . Common::prefixTable('logger_message') . '`
CHANGE `message` `message` TEXT' => false,
CHANGE `message` `message` TEXT' => 1054,
// 0.2.2 [489]
'ALTER IGNORE TABLE `' . Common::prefixTable('site') . '`
CHANGE `feedburnerName` `feedburnerName` VARCHAR( 100 ) DEFAULT NULL' => '1054',
'ALTER TABLE `' . Common::prefixTable('site') . '`
CHANGE `feedburnerName` `feedburnerName` VARCHAR( 100 ) DEFAULT NULL' => 1054,
);
}
static function update()
public function doUpdate(Updater $updater)
{
Updater::updateDatabase(__FILE__, self::getSql());
$obsoleteFile = '/plugins/ExamplePlugin/API.php';
if (file_exists(PIWIK_INCLUDE_PATH . $obsoleteFile)) {
@unlink(PIWIK_INCLUDE_PATH . $obsoleteFile);
}
$updater->executeMigrationQueries(__FILE__, $this->getMigrationQueries($updater));
$obsoleteDirectories = array(
'/plugins/AdminHome',

View file

@ -1,6 +1,6 @@
<?php
/**
* Piwik - Open source web analytics
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
@ -17,22 +17,22 @@ use Piwik\Updates;
*/
class Updates_0_2_12 extends Updates
{
static function getSql()
public function getMigrationQueries(Updater $updater)
{
return array(
'ALTER TABLE `' . Common::prefixTable('site') . '`
CHANGE `ts_created` `ts_created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL' => false,
'ALTER TABLE `' . Common::prefixTable('log_visit') . '`
DROP `config_color_depth`' => false,
DROP `config_color_depth`' => 1091,
// 0.2.12 [673]
// Note: requires INDEX privilege
'DROP INDEX index_idaction ON `' . Common::prefixTable('log_action') . '`' => '1091',
'DROP INDEX index_idaction ON `' . Common::prefixTable('log_action') . '`' => 1091,
);
}
static function update()
public function doUpdate(Updater $updater)
{
Updater::updateDatabase(__FILE__, self::getSql());
$updater->executeMigrationQueries(__FILE__, $this->getMigrationQueries($updater));
}
}

View file

@ -1,6 +1,6 @@
<?php
/**
* Piwik - Open source web analytics
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_0_2_13 extends Updates
{
static function getSql()
public function getMigrationQueries(Updater $updater)
{
return array(
'DROP TABLE IF EXISTS `' . Common::prefixTable('option') . '`' => false,
@ -27,12 +27,12 @@ class Updates_0_2_13 extends Updates
option_value LONGTEXT NOT NULL ,
autoload TINYINT NOT NULL DEFAULT '1',
PRIMARY KEY ( option_name )
)" => false,
)" => 1050,
);
}
static function update()
public function doUpdate(Updater $updater)
{
Updater::updateDatabase(__FILE__, self::getSql());
$updater->executeMigrationQueries(__FILE__, $this->getMigrationQueries($updater));
}
}

View file

@ -1,6 +1,6 @@
<?php
/**
* Piwik - Open source web analytics
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
@ -17,20 +17,20 @@ use Piwik\Updates;
*/
class Updates_0_2_24 extends Updates
{
static function getSql()
public function getMigrationQueries(Updater $updater)
{
return array(
'CREATE INDEX index_type_name
ON ' . Common::prefixTable('log_action') . ' (type, name(15))' => false,
ON ' . Common::prefixTable('log_action') . ' (type, name(15))' => 1072,
'CREATE INDEX index_idsite_date
ON ' . Common::prefixTable('log_visit') . ' (idsite, visit_server_date)' => false,
'DROP INDEX index_idsite ON ' . Common::prefixTable('log_visit') => false,
'DROP INDEX index_visit_server_date ON ' . Common::prefixTable('log_visit') => false,
ON ' . Common::prefixTable('log_visit') . ' (idsite, visit_server_date)' => 1072,
'DROP INDEX index_idsite ON ' . Common::prefixTable('log_visit') => 1091,
'DROP INDEX index_visit_server_date ON ' . Common::prefixTable('log_visit') => 1091,
);
}
static function update()
public function doUpdate(Updater $updater)
{
Updater::updateDatabase(__FILE__, self::getSql());
$updater->executeMigrationQueries(__FILE__, $this->getMigrationQueries($updater));
}
}

View file

@ -1,6 +1,6 @@
<?php
/**
* Piwik - Open source web analytics
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
@ -18,14 +18,14 @@ use Piwik\Updates;
*/
class Updates_0_2_27 extends Updates
{
static function getSql()
public function getMigrationQueries(Updater $updater)
{
$sqlarray = array(
'ALTER TABLE `' . Common::prefixTable('log_visit') . '`
ADD `visit_goal_converted` VARCHAR( 1 ) NOT NULL AFTER `visit_total_time`' => false,
ADD `visit_goal_converted` VARCHAR( 1 ) NOT NULL AFTER `visit_total_time`' => 1060,
// 0.2.27 [826]
'ALTER IGNORE TABLE `' . Common::prefixTable('log_visit') . '`
CHANGE `visit_goal_converted` `visit_goal_converted` TINYINT(1) NOT NULL' => false,
'ALTER TABLE `' . Common::prefixTable('log_visit') . '`
CHANGE `visit_goal_converted` `visit_goal_converted` TINYINT(1) NOT NULL' => 1060,
'CREATE TABLE `' . Common::prefixTable('goal') . "` (
`idsite` int(11) NOT NULL,
@ -38,7 +38,7 @@ class Updates_0_2_27 extends Updates
`revenue` float NOT NULL,
`deleted` tinyint(4) NOT NULL default '0',
PRIMARY KEY (`idsite`,`idgoal`)
)" => false,
)" => 1050,
'CREATE TABLE `' . Common::prefixTable('log_conversion') . '` (
`idvisit` int(10) unsigned NOT NULL,
@ -49,7 +49,6 @@ class Updates_0_2_27 extends Updates
`idaction` int(11) NOT NULL,
`idlink_va` int(11) NOT NULL,
`referer_idvisit` int(10) unsigned default NULL,
`referer_visit_server_date` date default NULL,
`referer_type` int(10) unsigned default NULL,
`referer_name` varchar(70) default NULL,
`referer_keyword` varchar(255) default NULL,
@ -61,21 +60,21 @@ class Updates_0_2_27 extends Updates
`revenue` float default NULL,
PRIMARY KEY (`idvisit`,`idgoal`),
KEY `index_idsite_date` (`idsite`,`visit_server_date`)
)' => false,
)' => 1050,
);
$tables = DbHelper::getTablesInstalled();
foreach ($tables as $tableName) {
if (preg_match('/archive_/', $tableName) == 1) {
$sqlarray['CREATE INDEX index_all ON ' . $tableName . ' (`idsite`,`date1`,`date2`,`name`,`ts_archived`)'] = false;
$sqlarray['CREATE INDEX index_all ON ' . $tableName . ' (`idsite`,`date1`,`date2`,`name`,`ts_archived`)'] = 1072;
}
}
return $sqlarray;
}
static function update()
public function doUpdate(Updater $updater)
{
Updater::updateDatabase(__FILE__, self::getSql());
$updater->executeMigrationQueries(__FILE__, $this->getMigrationQueries($updater));
}
}

View file

@ -1,6 +1,6 @@
<?php
/**
* Piwik - Open source web analytics
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_0_2_32 extends Updates
{
static function getSql()
public function getMigrationQueries(Updater $updater)
{
return array(
// 0.2.32 [941]
@ -32,8 +32,8 @@ class Updates_0_2_32 extends Updates
);
}
static function update()
public function doUpdate(Updater $updater)
{
Updater::updateDatabase(__FILE__, self::getSql());
$updater->executeMigrationQueries(__FILE__, $this->getMigrationQueries($updater));
}
}

View file

@ -1,6 +1,6 @@
<?php
/**
* Piwik - Open source web analytics
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
@ -18,7 +18,7 @@ use Piwik\Updates;
*/
class Updates_0_2_33 extends Updates
{
static function getSql()
public function getMigrationQueries(Updater $updater)
{
$sqlarray = array(
// 0.2.33 [1020]
@ -38,8 +38,8 @@ class Updates_0_2_33 extends Updates
return $sqlarray;
}
static function update()
public function doUpdate(Updater $updater)
{
Updater::updateDatabase(__FILE__, self::getSql());
$updater->executeMigrationQueries(__FILE__, $this->getMigrationQueries($updater));
}
}

View file

@ -1,28 +0,0 @@
<?php
/**
* Piwik - Open source web analytics
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Updates;
use Piwik\Piwik;
use Piwik\Plugins\SitesManager\API;
use Piwik\Tracker\Cache;
use Piwik\Updates;
/**
*/
class Updates_0_2_34 extends Updates
{
static function update()
{
// force regeneration of cache files following #648
Piwik::setUserHasSuperUserAccess();
$allSiteIds = API::getInstance()->getAllSitesId();
Cache::regenerateCacheWebsiteAttributes($allSiteIds);
}
}

View file

@ -1,6 +1,6 @@
<?php
/**
* Piwik - Open source web analytics
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_0_2_35 extends Updates
{
static function getSql()
public function getMigrationQueries(Updater $updater)
{
return array(
'ALTER TABLE `' . Common::prefixTable('user_dashboard') . '`
@ -25,8 +25,8 @@ class Updates_0_2_35 extends Updates
);
}
static function update()
public function doUpdate(Updater $updater)
{
Updater::updateDatabase(__FILE__, self::getSql());
$updater->executeMigrationQueries(__FILE__, $this->getMigrationQueries($updater));
}
}

View file

@ -1,6 +1,6 @@
<?php
/**
* Piwik - Open source web analytics
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_0_2_37 extends Updates
{
static function getSql()
public function getMigrationQueries(Updater $updater)
{
return array(
'DELETE FROM `' . Common::prefixTable('user_dashboard') . "`
@ -26,8 +26,8 @@ class Updates_0_2_37 extends Updates
);
}
static function update()
public function doUpdate(Updater $updater)
{
Updater::updateDatabase(__FILE__, self::getSql());
$updater->executeMigrationQueries(__FILE__, $this->getMigrationQueries($updater));
}
}

View file

@ -1,6 +1,6 @@
<?php
/**
* Piwik - Open source web analytics
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_0_4_1 extends Updates
{
static function getSql()
public function getMigrationQueries(Updater $updater)
{
return array(
'ALTER TABLE `' . Common::prefixTable('log_conversion') . '`
@ -27,8 +27,8 @@ class Updates_0_4_1 extends Updates
);
}
static function update()
public function doUpdate(Updater $updater)
{
Updater::updateDatabase(__FILE__, self::getSql());
$updater->executeMigrationQueries(__FILE__, $this->getMigrationQueries($updater));
}
}

View file

@ -1,6 +1,6 @@
<?php
/**
* Piwik - Open source web analytics
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
@ -17,22 +17,22 @@ use Piwik\Updates;
*/
class Updates_0_4_2 extends Updates
{
static function getSql()
public function getMigrationQueries(Updater $updater)
{
return array(
'ALTER TABLE `' . Common::prefixTable('log_visit') . '`
ADD `config_java` TINYINT(1) NOT NULL AFTER `config_flash`' => '1060',
ADD `config_java` TINYINT(1) NOT NULL AFTER `config_flash`' => 1060,
'ALTER TABLE `' . Common::prefixTable('log_visit') . '`
ADD `config_quicktime` TINYINT(1) NOT NULL AFTER `config_director`' => '1060',
ADD `config_quicktime` TINYINT(1) NOT NULL AFTER `config_director`' => 1060,
'ALTER TABLE `' . Common::prefixTable('log_visit') . '`
ADD `config_gears` TINYINT(1) NOT NULL AFTER `config_windowsmedia`,
ADD `config_silverlight` TINYINT(1) NOT NULL AFTER `config_gears`' => false,
ADD `config_silverlight` TINYINT(1) NOT NULL AFTER `config_gears`' => 1060,
);
}
// when restoring (possibly) previousy dropped columns, ignore mysql code error 1060: duplicate column
static function update()
public function doUpdate(Updater $updater)
{
Updater::updateDatabase(__FILE__, self::getSql());
$updater->executeMigrationQueries(__FILE__, $this->getMigrationQueries($updater));
}
}

View file

@ -1,6 +1,6 @@
<?php
/**
* Piwik - Open source web analytics
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
@ -11,12 +11,13 @@ namespace Piwik\Updates;
use Piwik\Piwik;
use Piwik\Updates;
use Piwik\Updater;
/**
*/
class Updates_0_4_4 extends Updates
{
static function update()
public function doUpdate(Updater $updater)
{
$obsoleteFile = PIWIK_DOCUMENT_ROOT . '/libs/open-flash-chart/php-ofc-library/ofc_upload_image.php';
if (file_exists($obsoleteFile)) {

View file

@ -1,6 +1,6 @@
<?php
/**
* Piwik - Open source web analytics
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
@ -17,23 +17,23 @@ use Piwik\Updates;
*/
class Updates_0_4 extends Updates
{
static function getSql()
public function getMigrationQueries(Updater $updater)
{
return array(
// 0.4 [1140]
'UPDATE `' . Common::prefixTable('log_visit') . '`
SET location_ip=location_ip+CAST(POW(2,32) AS UNSIGNED) WHERE location_ip < 0' => false,
SET location_ip=location_ip+CAST(POW(2,32) AS UNSIGNED) WHERE location_ip < 0' => false,
'ALTER TABLE `' . Common::prefixTable('log_visit') . '`
CHANGE `location_ip` `location_ip` BIGINT UNSIGNED NOT NULL' => false,
CHANGE `location_ip` `location_ip` BIGINT UNSIGNED NOT NULL' => 1054,
'UPDATE `' . Common::prefixTable('logger_api_call') . '`
SET caller_ip=caller_ip+CAST(POW(2,32) AS UNSIGNED) WHERE caller_ip < 0' => false,
SET caller_ip=caller_ip+CAST(POW(2,32) AS UNSIGNED) WHERE caller_ip < 0' => 1146,
'ALTER TABLE `' . Common::prefixTable('logger_api_call') . '`
CHANGE `caller_ip` `caller_ip` BIGINT UNSIGNED' => false,
CHANGE `caller_ip` `caller_ip` BIGINT UNSIGNED' => 1146,
);
}
static function update()
public function doUpdate(Updater $updater)
{
Updater::updateDatabase(__FILE__, self::getSql());
$updater->executeMigrationQueries(__FILE__, $this->getMigrationQueries($updater));
}
}

View file

@ -1,6 +1,6 @@
<?php
/**
* Piwik - Open source web analytics
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
@ -18,7 +18,7 @@ use Piwik\Updates;
*/
class Updates_0_5_4 extends Updates
{
static function getSql()
public function getMigrationQueries(Updater $updater)
{
return array(
'ALTER TABLE `' . Common::prefixTable('log_action') . '`
@ -26,7 +26,7 @@ class Updates_0_5_4 extends Updates
);
}
static function update()
public function doUpdate(Updater $updater)
{
$salt = Common::generateUniqId();
$config = Config::getInstance();
@ -60,6 +60,6 @@ class Updates_0_5_4 extends Updates
}
}
Updater::updateDatabase(__FILE__, self::getSql());
$updater->executeMigrationQueries(__FILE__, $this->getMigrationQueries($updater));
}
}

View file

@ -1,6 +1,6 @@
<?php
/**
* Piwik - Open source web analytics
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
@ -18,29 +18,28 @@ use Piwik\Updates;
*/
class Updates_0_5_5 extends Updates
{
static function getSql()
public function getMigrationQueries(Updater $updater)
{
$sqlarray = array(
'DROP INDEX index_idsite_date ON ' . Common::prefixTable('log_visit') => '1091',
'CREATE INDEX index_idsite_date_config ON ' . Common::prefixTable('log_visit') . ' (idsite, visit_server_date, config_md5config(8))' => '1061',
'DROP INDEX index_idsite_date ON ' . Common::prefixTable('log_visit') => 1091,
'CREATE INDEX index_idsite_date_config ON ' . Common::prefixTable('log_visit') . ' (idsite, visit_server_date, config_md5config(8))' => array(1061,1072),
);
$tables = DbHelper::getTablesInstalled();
foreach ($tables as $tableName) {
if (preg_match('/archive_/', $tableName) == 1) {
$sqlarray['DROP INDEX index_all ON ' . $tableName] = '1091';
$sqlarray['DROP INDEX index_all ON ' . $tableName] = 1091;
}
if (preg_match('/archive_numeric_/', $tableName) == 1) {
$sqlarray['CREATE INDEX index_idsite_dates_period ON ' . $tableName . ' (idsite, date1, date2, period)'] = '1061';
$sqlarray['CREATE INDEX index_idsite_dates_period ON ' . $tableName . ' (idsite, date1, date2, period)'] = 1061;
}
}
return $sqlarray;
}
static function update()
public function doUpdate(Updater $updater)
{
Updater::updateDatabase(__FILE__, self::getSql());
$updater->executeMigrationQueries(__FILE__, $this->getMigrationQueries($updater));
}
}

View file

@ -1,6 +1,6 @@
<?php
/**
* Piwik - Open source web analytics
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
@ -17,24 +17,24 @@ use Piwik\Updates;
*/
class Updates_0_5 extends Updates
{
static function getSql()
public function getMigrationQueries(Updater $updater)
{
return array(
'ALTER TABLE ' . Common::prefixTable('log_action') . ' ADD COLUMN `hash` INTEGER(10) UNSIGNED NOT NULL AFTER `name`;' => '1060',
'ALTER TABLE ' . Common::prefixTable('log_visit') . ' CHANGE visit_exit_idaction visit_exit_idaction_url INTEGER(11) NOT NULL;' => '1054',
'ALTER TABLE ' . Common::prefixTable('log_visit') . ' CHANGE visit_entry_idaction visit_entry_idaction_url INTEGER(11) NOT NULL;' => '1054',
'ALTER TABLE ' . Common::prefixTable('log_link_visit_action') . ' CHANGE `idaction_ref` `idaction_url_ref` INTEGER(10) UNSIGNED NOT NULL;' => '1054',
'ALTER TABLE ' . Common::prefixTable('log_link_visit_action') . ' CHANGE `idaction` `idaction_url` INTEGER(10) UNSIGNED NOT NULL;' => '1054',
'ALTER TABLE ' . Common::prefixTable('log_link_visit_action') . ' ADD COLUMN `idaction_name` INTEGER(10) UNSIGNED AFTER `idaction_url_ref`;' => '1060',
'ALTER TABLE ' . Common::prefixTable('log_conversion') . ' CHANGE `idaction` `idaction_url` INTEGER(11) UNSIGNED NOT NULL;' => '1054',
'ALTER TABLE ' . Common::prefixTable('log_action') . ' ADD COLUMN `hash` INTEGER(10) UNSIGNED NOT NULL AFTER `name`;' => 1060,
'ALTER TABLE ' . Common::prefixTable('log_visit') . ' CHANGE visit_exit_idaction visit_exit_idaction_url INTEGER(11) NOT NULL;' => 1054,
'ALTER TABLE ' . Common::prefixTable('log_visit') . ' CHANGE visit_entry_idaction visit_entry_idaction_url INTEGER(11) NOT NULL;' => 1054,
'ALTER TABLE ' . Common::prefixTable('log_link_visit_action') . ' CHANGE `idaction_ref` `idaction_url_ref` INTEGER(10) UNSIGNED NOT NULL;' => 1054,
'ALTER TABLE ' . Common::prefixTable('log_link_visit_action') . ' CHANGE `idaction` `idaction_url` INTEGER(10) UNSIGNED NOT NULL;' => 1054,
'ALTER TABLE ' . Common::prefixTable('log_link_visit_action') . ' ADD COLUMN `idaction_name` INTEGER(10) UNSIGNED AFTER `idaction_url_ref`;' => 1060,
'ALTER TABLE ' . Common::prefixTable('log_conversion') . ' CHANGE `idaction` `idaction_url` INTEGER(11) UNSIGNED NOT NULL;' => 1054,
'UPDATE ' . Common::prefixTable('log_action') . ' SET `hash` = CRC32(name);' => false,
'CREATE INDEX index_type_hash ON ' . Common::prefixTable('log_action') . ' (type, hash);' => '1061',
'DROP INDEX index_type_name ON ' . Common::prefixTable('log_action') . ';' => '1091',
'CREATE INDEX index_type_hash ON ' . Common::prefixTable('log_action') . ' (type, hash);' => 1061,
'DROP INDEX index_type_name ON ' . Common::prefixTable('log_action') . ';' => 1091,
);
}
static function update()
public function doUpdate(Updater $updater)
{
Updater::updateDatabase(__FILE__, self::getSql());
$updater->executeMigrationQueries(__FILE__, $this->getMigrationQueries($updater));
}
}

View file

@ -1,6 +1,6 @@
<?php
/**
* Piwik - Open source web analytics
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
@ -17,33 +17,33 @@ use Piwik\Updates;
*/
class Updates_0_6_rc1 extends Updates
{
static function getSql()
public function getMigrationQueries(Updater $updater)
{
$defaultTimezone = 'UTC';
$defaultCurrency = 'USD';
return array(
'ALTER TABLE ' . Common::prefixTable('user') . ' CHANGE date_registered date_registered TIMESTAMP NULL' => false,
'ALTER TABLE ' . Common::prefixTable('site') . ' CHANGE ts_created ts_created TIMESTAMP NULL' => false,
'ALTER TABLE ' . Common::prefixTable('site') . ' ADD `timezone` VARCHAR( 50 ) NOT NULL AFTER `ts_created` ;' => false,
'UPDATE ' . Common::prefixTable('site') . ' SET `timezone` = "' . $defaultTimezone . '";' => false,
'ALTER TABLE ' . Common::prefixTable('site') . ' ADD currency CHAR( 3 ) NOT NULL AFTER `timezone` ;' => false,
'UPDATE ' . Common::prefixTable('site') . ' SET `currency` = "' . $defaultCurrency . '";' => false,
'ALTER TABLE ' . Common::prefixTable('site') . ' ADD `excluded_ips` TEXT NOT NULL AFTER `currency` ;' => false,
'ALTER TABLE ' . Common::prefixTable('site') . ' ADD excluded_parameters VARCHAR( 255 ) NOT NULL AFTER `excluded_ips` ;' => false,
'ALTER TABLE ' . Common::prefixTable('log_visit') . ' ADD INDEX `index_idsite_datetime_config` ( `idsite` , `visit_last_action_time` , `config_md5config` ( 8 ) ) ;' => false,
'ALTER TABLE ' . Common::prefixTable('log_visit') . ' ADD INDEX index_idsite_idvisit (idsite, idvisit) ;' => false,
'ALTER TABLE ' . Common::prefixTable('log_conversion') . ' DROP INDEX index_idsite_date' => false,
'ALTER TABLE ' . Common::prefixTable('log_conversion') . ' DROP visit_server_date;' => false,
'ALTER TABLE ' . Common::prefixTable('log_conversion') . ' ADD INDEX index_idsite_datetime ( `idsite` , `server_time` )' => false,
'ALTER TABLE ' . Common::prefixTable('user') . ' CHANGE date_registered date_registered TIMESTAMP NULL' => 1054,
'ALTER TABLE ' . Common::prefixTable('site') . ' CHANGE ts_created ts_created TIMESTAMP NULL' => 1054,
'ALTER TABLE ' . Common::prefixTable('site') . ' ADD `timezone` VARCHAR( 50 ) NOT NULL AFTER `ts_created` ;' => 1060,
'UPDATE ' . Common::prefixTable('site') . ' SET `timezone` = "' . $defaultTimezone . '";' => 1060,
'ALTER TABLE ' . Common::prefixTable('site') . ' ADD currency CHAR( 3 ) NOT NULL AFTER `timezone` ;' => 1060,
'UPDATE ' . Common::prefixTable('site') . ' SET `currency` = "' . $defaultCurrency . '";' => 1060,
'ALTER TABLE ' . Common::prefixTable('site') . ' ADD `excluded_ips` TEXT NOT NULL AFTER `currency` ;' => 1060,
'ALTER TABLE ' . Common::prefixTable('site') . ' ADD excluded_parameters VARCHAR( 255 ) NOT NULL AFTER `excluded_ips` ;' => 1060,
'ALTER TABLE ' . Common::prefixTable('log_visit') . ' ADD INDEX `index_idsite_datetime_config` ( `idsite` , `visit_last_action_time` , `config_md5config` ( 8 ) ) ;' => array(1061, 1072),
'ALTER TABLE ' . Common::prefixTable('log_visit') . ' ADD INDEX index_idsite_idvisit (idsite, idvisit) ;' => array(1061, 1072),
'ALTER TABLE ' . Common::prefixTable('log_conversion') . ' DROP INDEX index_idsite_date' => 1091,
'ALTER TABLE ' . Common::prefixTable('log_conversion') . ' DROP visit_server_date;' => 1091,
'ALTER TABLE ' . Common::prefixTable('log_conversion') . ' ADD INDEX index_idsite_datetime ( `idsite` , `server_time` )' => array(1072, 1061),
);
}
static function update()
public function doUpdate(Updater $updater)
{
// first we disable the plugins and keep an array of warnings messages
$pluginsToDisableMessage = array(
'SearchEnginePosition' => "SearchEnginePosition plugin was disabled, because it is not compatible with the new Piwik 0.6. \n You can download the latest version of the plugin, compatible with Piwik 0.6.\n<a target='_blank' href='?module=Proxy&action=redirect&url=http://dev.piwik.org/trac/ticket/502'>Click here.</a>",
'GeoIP' => "GeoIP plugin was disabled, because it is not compatible with the new Piwik 0.6. \nYou can download the latest version of the plugin, compatible with Piwik 0.6.\n<a target='_blank' href='?module=Proxy&action=redirect&url=http://dev.piwik.org/trac/ticket/45'>Click here.</a>"
'SearchEnginePosition' => "SearchEnginePosition plugin was disabled, because it is not compatible with the new Piwik 0.6. \n You can download the latest version of the plugin, compatible with Piwik 0.6.\n<a target='_blank' href='?module=Proxy&action=redirect&url=https://github.com/piwik/piwik/issues/502'>Click here.</a>",
'GeoIP' => "GeoIP plugin was disabled, because it is not compatible with the new Piwik 0.6. \nYou can download the latest version of the plugin, compatible with Piwik 0.6.\n<a target='_blank' href='?module=Proxy&action=redirect&url=https://github.com/piwik/piwik/issues/45'>Click here.</a>"
);
$disabledPlugins = array();
foreach ($pluginsToDisableMessage as $pluginToDisable => $warningMessage) {
@ -54,7 +54,7 @@ class Updates_0_6_rc1 extends Updates
}
// Run the SQL
Updater::updateDatabase(__FILE__, self::getSql());
$updater->executeMigrationQueries(__FILE__, $this->getMigrationQueries($updater));
// Outputs warning message, pointing users to the plugin download page
if (!empty($disabledPlugins)) {

View file

@ -1,47 +0,0 @@
<?php
/**
* Piwik - Open source web analytics
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Updates;
use Piwik\Filesystem;
use Piwik\Piwik;
use Piwik\Plugins\SitesManager\API;
use Piwik\Tracker\Cache;
use Piwik\Updates;
/**
*/
class Updates_0_6_2 extends Updates
{
static function update()
{
$obsoleteFiles = array(
PIWIK_INCLUDE_PATH . '/core/Db/Mysqli.php',
);
foreach ($obsoleteFiles as $obsoleteFile) {
if (file_exists($obsoleteFile)) {
@unlink($obsoleteFile);
}
}
$obsoleteDirectories = array(
PIWIK_INCLUDE_PATH . '/core/Db/Pdo',
);
foreach ($obsoleteDirectories as $dir) {
if (file_exists($dir)) {
Filesystem::unlinkRecursive($dir, true);
}
}
// force regeneration of cache files
Piwik::setUserHasSuperUserAccess();
$allSiteIds = API::getInstance()->getAllSitesId();
Cache::regenerateCacheWebsiteAttributes($allSiteIds);
}
}

View file

@ -1,6 +1,6 @@
<?php
/**
* Piwik - Open source web analytics
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
@ -18,17 +18,17 @@ use Piwik\Updates;
*/
class Updates_0_6_3 extends Updates
{
static function getSql()
public function getMigrationQueries(Updater $updater)
{
return array(
'ALTER TABLE `' . Common::prefixTable('log_visit') . '`
CHANGE `location_ip` `location_ip` INT UNSIGNED NOT NULL' => false,
CHANGE `location_ip` `location_ip` INT UNSIGNED NOT NULL' => 1054,
'ALTER TABLE `' . Common::prefixTable('logger_api_call') . '`
CHANGE `caller_ip` `caller_ip` INT UNSIGNED' => false,
CHANGE `caller_ip` `caller_ip` INT UNSIGNED' => array(1054, 1146),
);
}
static function update()
public function doUpdate(Updater $updater)
{
$config = Config::getInstance();
$dbInfos = $config->database;
@ -44,6 +44,6 @@ class Updates_0_6_3 extends Updates
}
}
Updater::updateDatabase(__FILE__, self::getSql());
$updater->executeMigrationQueries(__FILE__, $this->getMigrationQueries($updater));
}
}

Some files were not shown because too many files have changed in this diff Show more