MyBB Community Forums

Full Version: Add An Upgrade Option To Plugins
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
When releasing plugins it would be nice if developers could have some built-in method for versioning. If the Admin has another option for plugins that would appear when an upgrade was necessary. This would execute an upgrade script within the plugin.

Maybe add optional two functions to plugins: _is_upgraded and _upgrade

Developers could check the version and provide different methods of installation based on the current version. If it were made so that the plugin itself were responsible for determining if upgrade were necessary (_is_upgraded) then it would be a simple matter for the developer to look for certain elements of the installation to determine version.

_is_upgraded would be ignored if _is_installed was false (no link in ACP)

So the developer could release a new plugin and instruct the users to overwrite existing files and then Upgrade. The benefit being that user settings could be maintained while still updating to the latest software (much like MyBB upgrades).

Just something I've been mulling over . . .
I think - if you look at pavemen's MyBB publisher plugin it does something very similar to that (he uses a cache mechanism to do it).
Thanks for the tip, I will check it out. Smile
I've been thinking something like this. A link next to activate and install for upgrade and that takes you to a page where you choose the current version a bit like the install script in the default package.
^That or something simpler that just executes the upgrade function of the plugin and have the plugin determine what needs updating.
Yes we seem to be on the same wave length.
I believe this has been brought up a few times. Guess you'll just have to wait and see what hapens in the future...

For now though, the best thing to do is use the cache to store the current version and write your own upgrade files. It's what I'm doing.
Of course I have no idea exactly what kind of changes would need to be made in the current system to make this happen. That is why I am bringing it up.

Apologies if it has been discussed before, I honestly didn't search Blush

To me it is just a little confusing to ask a user to overwrite files and then click Install (even though the plugin was previously installed). Fooling the _is_installed check is one option (that I will probably end up using) but I don't care for that.

I will look into using the cache.
I'm not sure if the previous discussions were public or not but I certainly remember reading them.

The current method certainly isn't all that clean but it does get the job done.
I have brought this up internally in the past but to be honest I can't really remember what the outcome was.
Pages: 1 2