diff options
Diffstat (limited to 'core/Updates/0.5.4.php')
-rw-r--r-- | core/Updates/0.5.4.php | 82 |
1 files changed, 37 insertions, 45 deletions
diff --git a/core/Updates/0.5.4.php b/core/Updates/0.5.4.php index 8ca779dc49..733fccfd3d 100644 --- a/core/Updates/0.5.4.php +++ b/core/Updates/0.5.4.php @@ -14,56 +14,48 @@ */ class Piwik_Updates_0_5_4 extends Piwik_Updates { - static function getSql($schema = 'Myisam') - { - return array( - 'ALTER TABLE `'. Piwik_Common::prefixTable('log_action') .'` + static function getSql($schema = 'Myisam') + { + return array( + 'ALTER TABLE `' . Piwik_Common::prefixTable('log_action') . '` CHANGE `name` `name` TEXT' => false, - ); - } + ); + } - static function update() - { - $salt = Piwik_Common::generateUniqId(); + static function update() + { + $salt = Piwik_Common::generateUniqId(); $config = Piwik_Config::getInstance(); $superuser = $config->superuser; - if(!isset($superuser['salt'])) - { - try { - if(is_writable( Piwik_Config::getLocalConfigPath() )) - { - $superuser['salt'] = $salt; + if (!isset($superuser['salt'])) { + try { + if (is_writable(Piwik_Config::getLocalConfigPath())) { + $superuser['salt'] = $salt; $config->superuser = $superuser; - $config->forceSave(); - } - else - { - throw new Exception('mandatory update failed'); - } - } catch(Exception $e) { - throw new Piwik_Updater_UpdateErrorException("Please edit your config/config.ini.php file and add below <code>[superuser]</code> the following line: <br /><code>salt = $salt</code>"); - } - } + $config->forceSave(); + } else { + throw new Exception('mandatory update failed'); + } + } catch (Exception $e) { + throw new Piwik_Updater_UpdateErrorException("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( Piwik_Config::getLocalConfigPath() )) - { - $plugins[] = 'MultiSites'; + $plugins = $config->Plugins; + if (!in_array('MultiSites', $plugins)) { + try { + if (is_writable(Piwik_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!"); - } - } - - Piwik_Updater::updateDatabase(__FILE__, self::getSql()); - } + $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!"); + } + } + + Piwik_Updater::updateDatabase(__FILE__, self::getSql()); + } } |