Skip to content
Extraits de code Groupes Projets
Valider eca17c0b rédigé par Matthieu Aubry's avatar Matthieu Aubry
Parcourir les fichiers

Merge pull request #9218 from piwik/9160

Show an error message if installing a plugin fails
parents b8b4e063 ea30714a
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -440,16 +440,10 @@ class Manager ...@@ -440,16 +440,10 @@ class Manager
public function installLoadedPlugins() public function installLoadedPlugins()
{ {
Log::debug("Loaded plugins: " . implode(", ", array_keys($this->getLoadedPlugins()))); Log::debug("Loaded plugins: " . implode(", ", array_keys($this->getLoadedPlugins())));
$messages = array();
foreach ($this->getLoadedPlugins() as $plugin) { foreach ($this->getLoadedPlugins() as $plugin) {
try { $this->installPluginIfNecessary($plugin);
$this->installPluginIfNecessary($plugin);
} catch (\Exception $e) {
$messages[] = $e->getMessage();
}
} }
return $messages;
} }
/** /**
......
...@@ -8,14 +8,28 @@ ...@@ -8,14 +8,28 @@
namespace Piwik\Plugin; namespace Piwik\Plugin;
use Piwik\Common;
class PluginException extends \Exception class PluginException extends \Exception
{ {
public function __construct($pluginName, $message) public function __construct($pluginName, $message)
{ {
parent::__construct("There was a problem installing the plugin " . $pluginName . ": " . $message . " $pluginName = Common::sanitizeInputValue($pluginName);
If this plugin has already been installed, and if you want to hide this message</b>, you must add the following line under the $message = Common::sanitizeInputValue($message);
[PluginsInstalled]
entry in your config/config.ini.php file: parent::__construct("There was a problem installing the plugin $pluginName: <br /><br />
PluginsInstalled[] = $pluginName"); $message
<br /><br />
If you want to hide this message you must remove the following line under the [Plugins] entry in your
'config/config.ini.php' file to disable this plugin.<br />
Plugins[] = $pluginName
<br /><br />If this plugin has already been installed, you must add the following line under the
[PluginsInstalled] entry in your 'config/config.ini.php' file:<br />
PluginsInstalled[] = $pluginName");
}
public function isHtmlMessage()
{
return true;
} }
} }
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