Fixed bug with plugin status on install/uninstall
At 95ac85c6d453fed166994e11a883bdc63a871e7a plugin installation system was broken, and saves status of installation/deinstallation as 'success' in all cases. I fixed it.
Saving plugin status as 'installed'/'uninstalled' only if corresponding action finished properly Also added messages for failed plugin installation.
I don't think this is necessary, as you can see in the Community Bans plugin, the new way is to throw an exception. The error message is then returned via AJAX. The documentation in SBPlugin just wasn't updated.
Maybe, but why if I return false from runInstall - plugin will marked as installed?
Why break something that already works?
Or if you think, that throwing exception - is only right way - you should edit documentation of SBPlugin model in the part of "return value of runInstall or runUninstall functions"
Maybe, but why if I return false from runInstall - plugin will marked as installed?
Because it doesn't check for false anymore, it checks whether an exception was thrown.
Why break something that already works?
Sure, returning false worked, except that you had no idea what went wrong. Now you actually get an error message.
Or if you think, that throwing exception - is only right way - you should edit documentation of SBPlugin model in the part of "return value of runInstall or runUninstall functions"
I don't think it's the only right way, but for now it's the easiest way to stop the installation and return an error message. Especially since Yii also throws exceptions for SQL errors and such. Maybe in the future we'll want to return multiple error messages, then we can reconsider how it's implemented.
I updated the documentation in commit 7b145fbc1ef7e61060a39b399cd493057509c2a3.