add piwik installation

This commit is contained in:
coderkun 2014-04-25 03:56:02 +02:00
commit 8c5d4f0c31
73 changed files with 563902 additions and 0 deletions

View file

@ -0,0 +1,73 @@
<?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\Common;
use Piwik\Filesystem;
use Piwik\Updater;
use Piwik\Updates;
/**
*/
class Updates_0_2_10 extends Updates
{
static function getSql()
{
return array(
'CREATE TABLE `' . Common::prefixTable('option') . '` (
idoption BIGINT NOT NULL AUTO_INCREMENT ,
option_name VARCHAR( 64 ) NOT NULL ,
option_value LONGTEXT NOT NULL ,
PRIMARY KEY ( idoption , option_name )
)' => false,
// 0.1.7 [463]
'ALTER IGNORE 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,
'ALTER TABLE `' . Common::prefixTable('logger_error') . '`
CHANGE `message` `message` TEXT' => false,
'ALTER TABLE `' . Common::prefixTable('logger_exception') . '`
CHANGE `message` `message` TEXT' => false,
'ALTER TABLE `' . Common::prefixTable('logger_message') . '`
CHANGE `message` `message` TEXT' => false,
// 0.2.2 [489]
'ALTER IGNORE TABLE `' . Common::prefixTable('site') . '`
CHANGE `feedburnerName` `feedburnerName` VARCHAR( 100 ) DEFAULT NULL' => '1054',
);
}
static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
$obsoleteFile = '/plugins/ExamplePlugin/API.php';
if (file_exists(PIWIK_INCLUDE_PATH . $obsoleteFile)) {
@unlink(PIWIK_INCLUDE_PATH . $obsoleteFile);
}
$obsoleteDirectories = array(
'/plugins/AdminHome',
'/plugins/Home',
'/plugins/PluginsAdmin',
);
foreach ($obsoleteDirectories as $dir) {
if (file_exists(PIWIK_INCLUDE_PATH . $dir)) {
Filesystem::unlinkRecursive(PIWIK_INCLUDE_PATH . $dir, true);
}
}
}
}

View file

@ -0,0 +1,38 @@
<?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\Common;
use Piwik\Updater;
use Piwik\Updates;
/**
*/
class Updates_0_2_12 extends Updates
{
static function getSql()
{
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,
// 0.2.12 [673]
// Note: requires INDEX privilege
'DROP INDEX index_idaction ON `' . Common::prefixTable('log_action') . '`' => '1091',
);
}
static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
}

View file

@ -0,0 +1,38 @@
<?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\Common;
use Piwik\Updater;
use Piwik\Updates;
/**
*/
class Updates_0_2_13 extends Updates
{
static function getSql()
{
return array(
'DROP TABLE IF EXISTS `' . Common::prefixTable('option') . '`' => false,
'CREATE TABLE `' . Common::prefixTable('option') . "` (
option_name VARCHAR( 64 ) NOT NULL ,
option_value LONGTEXT NOT NULL ,
autoload TINYINT NOT NULL DEFAULT '1',
PRIMARY KEY ( option_name )
)" => false,
);
}
static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
}

View file

@ -0,0 +1,36 @@
<?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\Common;
use Piwik\Updater;
use Piwik\Updates;
/**
*/
class Updates_0_2_24 extends Updates
{
static function getSql()
{
return array(
'CREATE INDEX index_type_name
ON ' . Common::prefixTable('log_action') . ' (type, name(15))' => false,
'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,
);
}
static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
}

View file

@ -0,0 +1,81 @@
<?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\Common;
use Piwik\DbHelper;
use Piwik\Updater;
use Piwik\Updates;
/**
*/
class Updates_0_2_27 extends Updates
{
static function getSql()
{
$sqlarray = array(
'ALTER TABLE `' . Common::prefixTable('log_visit') . '`
ADD `visit_goal_converted` VARCHAR( 1 ) NOT NULL AFTER `visit_total_time`' => false,
// 0.2.27 [826]
'ALTER IGNORE TABLE `' . Common::prefixTable('log_visit') . '`
CHANGE `visit_goal_converted` `visit_goal_converted` TINYINT(1) NOT NULL' => false,
'CREATE TABLE `' . Common::prefixTable('goal') . "` (
`idsite` int(11) NOT NULL,
`idgoal` int(11) NOT NULL,
`name` varchar(50) NOT NULL,
`match_attribute` varchar(20) NOT NULL,
`pattern` varchar(255) NOT NULL,
`pattern_type` varchar(10) NOT NULL,
`case_sensitive` tinyint(4) NOT NULL,
`revenue` float NOT NULL,
`deleted` tinyint(4) NOT NULL default '0',
PRIMARY KEY (`idsite`,`idgoal`)
)" => false,
'CREATE TABLE `' . Common::prefixTable('log_conversion') . '` (
`idvisit` int(10) unsigned NOT NULL,
`idsite` int(10) unsigned NOT NULL,
`visitor_idcookie` char(32) NOT NULL,
`server_time` datetime NOT NULL,
`visit_server_date` date NOT NULL,
`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,
`visitor_returning` tinyint(1) NOT NULL,
`location_country` char(3) NOT NULL,
`location_continent` char(3) NOT NULL,
`url` text NOT NULL,
`idgoal` int(10) unsigned NOT NULL,
`revenue` float default NULL,
PRIMARY KEY (`idvisit`,`idgoal`),
KEY `index_idsite_date` (`idsite`,`visit_server_date`)
)' => false,
);
$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;
}
}
return $sqlarray;
}
static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
}

View file

@ -0,0 +1,39 @@
<?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\Common;
use Piwik\Updater;
use Piwik\Updates;
/**
*/
class Updates_0_2_32 extends Updates
{
static function getSql()
{
return array(
// 0.2.32 [941]
'ALTER TABLE `' . Common::prefixTable('access') . '`
CHANGE `login` `login` VARCHAR( 100 ) NOT NULL' => false,
'ALTER TABLE `' . Common::prefixTable('user') . '`
CHANGE `login` `login` VARCHAR( 100 ) NOT NULL' => false,
'ALTER TABLE `' . Common::prefixTable('user_dashboard') . '`
CHANGE `login` `login` VARCHAR( 100 ) NOT NULL' => '1146',
'ALTER TABLE `' . Common::prefixTable('user_language') . '`
CHANGE `login` `login` VARCHAR( 100 ) NOT NULL' => '1146',
);
}
static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
}

View file

@ -0,0 +1,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
*
*/
namespace Piwik\Updates;
use Piwik\Common;
use Piwik\DbHelper;
use Piwik\Updater;
use Piwik\Updates;
/**
*/
class Updates_0_2_33 extends Updates
{
static function getSql()
{
$sqlarray = array(
// 0.2.33 [1020]
'ALTER TABLE `' . Common::prefixTable('user_dashboard') . '`
CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci ' => '1146',
'ALTER TABLE `' . Common::prefixTable('user_language') . '`
CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci ' => '1146',
);
// alter table to set the utf8 collation
$tablesToAlter = DbHelper::getTablesInstalled(true);
foreach ($tablesToAlter as $table) {
$sqlarray['ALTER TABLE `' . $table . '`
CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci '] = false;
}
return $sqlarray;
}
static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
}

View file

@ -0,0 +1,28 @@
<?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

@ -0,0 +1,32 @@
<?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\Common;
use Piwik\Updater;
use Piwik\Updates;
/**
*/
class Updates_0_2_35 extends Updates
{
static function getSql()
{
return array(
'ALTER TABLE `' . Common::prefixTable('user_dashboard') . '`
CHANGE `layout` `layout` TEXT NOT NULL' => false,
);
}
static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
}

View file

@ -0,0 +1,33 @@
<?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\Common;
use Piwik\Updater;
use Piwik\Updates;
/**
*/
class Updates_0_2_37 extends Updates
{
static function getSql()
{
return array(
'DELETE FROM `' . Common::prefixTable('user_dashboard') . "`
WHERE layout LIKE '%.getLastVisitsGraph%'
OR layout LIKE '%.getLastVisitsReturningGraph%'" => false,
);
}
static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
}

View file

@ -0,0 +1,34 @@
<?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\Common;
use Piwik\Updater;
use Piwik\Updates;
/**
*/
class Updates_0_4_1 extends Updates
{
static function getSql()
{
return array(
'ALTER TABLE `' . Common::prefixTable('log_conversion') . '`
CHANGE `idlink_va` `idlink_va` INT(11) DEFAULT NULL' => false,
'ALTER TABLE `' . Common::prefixTable('log_conversion') . '`
CHANGE `idaction` `idaction` INT(11) DEFAULT NULL' => '1054',
);
}
static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
}

View file

@ -0,0 +1,38 @@
<?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\Common;
use Piwik\Updater;
use Piwik\Updates;
/**
*/
class Updates_0_4_2 extends Updates
{
static function getSql()
{
return array(
'ALTER TABLE `' . Common::prefixTable('log_visit') . '`
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',
'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,
);
}
// when restoring (possibly) previousy dropped columns, ignore mysql code error 1060: duplicate column
static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
}

View file

@ -0,0 +1,29 @@
<?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\Updates;
/**
*/
class Updates_0_4_4 extends Updates
{
static function update()
{
$obsoleteFile = PIWIK_DOCUMENT_ROOT . '/libs/open-flash-chart/php-ofc-library/ofc_upload_image.php';
if (file_exists($obsoleteFile)) {
$rc = @unlink($obsoleteFile);
if (!$rc) {
throw new \Exception(Piwik::translate('General_ExceptionUndeletableFile', array($obsoleteFile)));
}
}
}
}

View file

@ -0,0 +1,39 @@
<?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\Common;
use Piwik\Updater;
use Piwik\Updates;
/**
*/
class Updates_0_4 extends Updates
{
static function getSql()
{
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,
'ALTER TABLE `' . Common::prefixTable('log_visit') . '`
CHANGE `location_ip` `location_ip` BIGINT UNSIGNED NOT NULL' => false,
'UPDATE `' . Common::prefixTable('logger_api_call') . '`
SET caller_ip=caller_ip+CAST(POW(2,32) AS UNSIGNED) WHERE caller_ip < 0' => false,
'ALTER TABLE `' . Common::prefixTable('logger_api_call') . '`
CHANGE `caller_ip` `caller_ip` BIGINT UNSIGNED' => false,
);
}
static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
}

View file

@ -0,0 +1,65 @@
<?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\Common;
use Piwik\Config;
use Piwik\Updater;
use Piwik\Updates;
/**
*/
class Updates_0_5_4 extends Updates
{
static function getSql()
{
return array(
'ALTER TABLE `' . Common::prefixTable('log_action') . '`
CHANGE `name` `name` TEXT' => false,
);
}
static function update()
{
$salt = Common::generateUniqId();
$config = Config::getInstance();
$superuser = $config->superuser;
if (!isset($superuser['salt'])) {
try {
if (is_writable(Config::getLocalConfigPath())) {
$superuser['salt'] = $salt;
$config->superuser = $superuser;
$config->forceSave();
} else {
throw new \Exception('mandatory update failed');
}
} catch (\Exception $e) {
throw new \Piwik\UpdaterErrorException("Please edit your config/config.ini.php file and add below <code>[superuser]</code> the following line: <br /><code>salt = $salt</code>");
}
}
$plugins = $config->Plugins;
if (!in_array('MultiSites', $plugins)) {
try {
if (is_writable(Config::getLocalConfigPath())) {
$plugins[] = 'MultiSites';
$config->Plugins = $plugins;
$config->forceSave();
} else {
throw new \Exception('optional update failed');
}
} catch (\Exception $e) {
throw new \Exception("You can now enable the new MultiSites plugin in the Plugins screen in the Piwik admin!");
}
}
Updater::updateDatabase(__FILE__, self::getSql());
}
}

View file

@ -0,0 +1,46 @@
<?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\Common;
use Piwik\DbHelper;
use Piwik\Updater;
use Piwik\Updates;
/**
*/
class Updates_0_5_5 extends Updates
{
static function getSql()
{
$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',
);
$tables = DbHelper::getTablesInstalled();
foreach ($tables as $tableName) {
if (preg_match('/archive_/', $tableName) == 1) {
$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';
}
}
return $sqlarray;
}
static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
}

View file

@ -0,0 +1,40 @@
<?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\Common;
use Piwik\Updater;
use Piwik\Updates;
/**
*/
class Updates_0_5 extends Updates
{
static function getSql()
{
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',
'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',
);
}
static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
}

View file

@ -0,0 +1,67 @@
<?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\Common;
use Piwik\Updater;
use Piwik\Updates;
/**
*/
class Updates_0_6_rc1 extends Updates
{
static function getSql()
{
$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,
);
}
static function update()
{
// 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>"
);
$disabledPlugins = array();
foreach ($pluginsToDisableMessage as $pluginToDisable => $warningMessage) {
if (\Piwik\Plugin\Manager::getInstance()->isPluginActivated($pluginToDisable)) {
\Piwik\Plugin\Manager::getInstance()->deactivatePlugin($pluginToDisable);
$disabledPlugins[] = $warningMessage;
}
}
// Run the SQL
Updater::updateDatabase(__FILE__, self::getSql());
// Outputs warning message, pointing users to the plugin download page
if (!empty($disabledPlugins)) {
throw new \Exception("The following plugins were disabled during the upgrade:"
. "<ul><li>" .
implode('</li><li>', $disabledPlugins) .
"</li></ul>");
}
}
}

View file

@ -0,0 +1,47 @@
<?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

@ -0,0 +1,49 @@
<?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\Common;
use Piwik\Config;
use Piwik\Updater;
use Piwik\Updates;
/**
*/
class Updates_0_6_3 extends Updates
{
static function getSql()
{
return array(
'ALTER TABLE `' . Common::prefixTable('log_visit') . '`
CHANGE `location_ip` `location_ip` INT UNSIGNED NOT NULL' => false,
'ALTER TABLE `' . Common::prefixTable('logger_api_call') . '`
CHANGE `caller_ip` `caller_ip` INT UNSIGNED' => false,
);
}
static function update()
{
$config = Config::getInstance();
$dbInfos = $config->database;
if (!isset($dbInfos['schema'])) {
try {
if (is_writable(Config::getLocalConfigPath())) {
$config->database = $dbInfos;
$config->forceSave();
} else {
throw new \Exception('mandatory update failed');
}
} catch (\Exception $e) {
}
}
Updater::updateDatabase(__FILE__, self::getSql());
}
}

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