diff options
author | matt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2008-03-20 15:31:55 +0300 |
---|---|---|
committer | matt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2008-03-20 15:31:55 +0300 |
commit | 0f8715280ed7b96387304a44d73b617326109f2a (patch) | |
tree | 34c4914e0a9db3a864fd5a3a6ce1e950dd6e184b /plugins/ExamplePlugin | |
parent | 4ff072dc39f9ed70fbb7b602e09acf1db0c20f6d (diff) |
- fix #153 "After reinstalling piwik Dashboard plugin is not enabled"
Diffstat (limited to 'plugins/ExamplePlugin')
-rw-r--r-- | plugins/ExamplePlugin/ExamplePlugin.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/plugins/ExamplePlugin/ExamplePlugin.php b/plugins/ExamplePlugin/ExamplePlugin.php index 368271874a..06662b860f 100644 --- a/plugins/ExamplePlugin/ExamplePlugin.php +++ b/plugins/ExamplePlugin/ExamplePlugin.php @@ -26,7 +26,16 @@ class Piwik_ExamplePlugin extends Piwik_Plugin function install() { - Piwik_Query('ALTER TABLE '.Piwik::prefixTable('site'). " ADD `feedburnerName` VARCHAR( 100 ) NOT NULL ;"); + try{ + Piwik_Query('ALTER TABLE '.Piwik::prefixTable('site'). " ADD `feedburnerName` VARCHAR( 100 ) NOT NULL ;"); + } catch(Zend_Db_Statement_Exception $e){ + // mysql code error 1060: column already exists + // if there is another error we throw the exception, otherwise it is OK as we are simply reinstalling the plugin + if(!ereg('1060',$e->getMessage())) + { + throw $e; + } + } } function uninstall() { |