MyBB Community Forums

Full Version: Plugin Update/Upgrade functionality
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Just an idea for better plugin support in feature, every plugin have already an version number.
What if we store this version number on installation routine in the database, if some one now upload a new version we can detect the changed version number and are able to call a plugin upgrade/update routine.

This will add update(or upgrade) to the exists functions like install, uninstall, activate and deaktivate.
This will give better upgradeablility without losing data from existing plugins, for example update table structures instead of use uninstall routine (lose exists data) and reinstall just for updating a used plugin.
Totally support this Big Grin
I always felt this was missing from plugins.
The big questions are:

how to store the installed version number (db table with the value being included in the plugins cache)?
how often to compare the db version with the php version (possibly at the same time the plugin cache is created / updated)?
should the plugin should automatically be deactivated if these two don't match?
First i would just store them in db, it enough to read them when you open the plugin page itself in the ACP.
A second feature to realize with this methode will be to make an optional update check for plugins in the same time or seperate to the mybb version check it self.
Sounds like a big feature for me in combination with the new plugin page. A plugin dev just release a new version on mybb.com and if an admin click on version check for mybb (or may seperate link for plugin version check) they get a notification about new released versions.
Plugins will be composer packages, and will make use of database migrations to handle creating or modifying tables, so that will solve the changing of table structures on upgrade.

We haven't yet decided how we're going to have plugins work with templates, but I want to add template hooks, which would solve the problem of changing templates at upgrade time in most cases (except when a hook is missing).

Additionally, plugins will be composer packages, and composer packages can specify commands to be ran after install, so we'll be able to leverage that in some way too.