Skip to content
Extraits de code Groupes Projets
Valider 45a88b9e rédigé par Fabian Becker's avatar Fabian Becker
Parcourir les fichiers

Piwik_Config::setConfigOption() is outdated and should not be used for upgrades.

refs #3852
parent f9aca379
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -25,12 +25,15 @@ class Piwik_Updates_0_5_4 extends Piwik_Updates ...@@ -25,12 +25,15 @@ class Piwik_Updates_0_5_4 extends Piwik_Updates
static function update() static function update()
{ {
$salt = Piwik_Common::generateUniqId(); $salt = Piwik_Common::generateUniqId();
if(!isset(Piwik_Config::getInstance()->superuser['salt'])) $config = Piwik_Config::getInstance();
$superuser = $config->superuser;
if(!isset($superuser['salt']))
{ {
try { try {
if(is_writable( Piwik_Config::getLocalConfigPath() )) if(is_writable( Piwik_Config::getLocalConfigPath() ))
{ {
Piwik_Config::getInstance()->setConfigOption('superuser', 'salt', $salt); $superuser['salt'] = $salt;
$config->superuser = $superuser;
Piwik_Config::getInstance()->forceSave(); Piwik_Config::getInstance()->forceSave();
} }
else else
...@@ -42,14 +45,14 @@ class Piwik_Updates_0_5_4 extends Piwik_Updates ...@@ -42,14 +45,14 @@ class Piwik_Updates_0_5_4 extends Piwik_Updates
} }
} }
$plugins = Piwik_Config::getInstance()->Plugins; $plugins = $config->Plugins;
if(!in_array('MultiSites', $plugins)) if(!in_array('MultiSites', $plugins))
{ {
try { try {
if(is_writable( Piwik_Config::getLocalConfigPath() )) if(is_writable( Piwik_Config::getLocalConfigPath() ))
{ {
$plugins[] = 'MultiSites'; $plugins[] = 'MultiSites';
Piwik_Config::getInstance()->setConfigSection('Plugins', $plugins); $config->Plugins = $plugins;
Piwik_Config::getInstance()->forceSave(); Piwik_Config::getInstance()->forceSave();
} }
else else
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter