Automatic Upgrade of modules

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
lemkepf
Forum Members
Forum Members
Posts: 163
Joined: Tue Oct 18, 2005 8:30 pm

Automatic Upgrade of modules

Post by lemkepf »

Hello Crew,
I personally can't see any reason why a module would have to be "upgraded" by clicking the little upgrade button... can someone enlighten me as to why?
Why not do an "automatic" upgrade the first time it's used?

So the question is... can anyone think of a way to do an "automatic" update of a module the first time it is used?

Thanks for the help!
Paul
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: Automatic Upgrade of modules

Post by Ted »

Well, I don't see any reason why automatic upgrades couldn't be done when the module is loaded at the beginning of the page display.

The only issue I could really see is that the module developer wants to display an upgrade message.

There is already a flag now that defaults to true that modules can override to turn off automatic upgrading.  However, this only applies when you run the upgrade.php script.  I suppose it coule work here as well...
lemkepf
Forum Members
Forum Members
Posts: 163
Joined: Tue Oct 18, 2005 8:30 pm

Re: Automatic Upgrade of modules

Post by lemkepf »

wishy wrote: Well, I don't see any reason why automatic upgrades couldn't be done when the module is loaded at the beginning of the page display.

The only issue I could really see is that the module developer wants to display an upgrade message.

There is already a flag now that defaults to true that modules can override to turn off automatic upgrading.  However, this only applies when you run the upgrade.php script.  I suppose it coule work here as well...
That's the reason! I knew there was one... but... i have to thank you. :) I didn't even know "function module_autoupgrade()" existed!!!

I'm working on something for my web hosting company to allow a central install of "CMS Made Simple" so they don't have to worry about the upgrades etc. The only issue is what to do about any module updates we put it. So this might solve our issue.

Here is my idea... along with the default install we'll create a php file called "upgrade_mod.php" that would have that autoupgrade function in it. Then when we do a module upgrade we can use a script or something to automatically do an "http fetch" against all the accounts that use that module so it would automatically upgrade their modules.

Or... do you think there is a better way?
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: Automatic Upgrade of modules

Post by Ted »

I just committed a better way.  :)

Basically, if the module can auto upgrade itself, it will do it on the next page load.  So, you could send it out to all of the installs and it'll "just work" next time a page is requested.
lemkepf
Forum Members
Forum Members
Posts: 163
Joined: Tue Oct 18, 2005 8:30 pm

Re: Automatic Upgrade of modules

Post by lemkepf »

But not all of them are? What could i do about the ones that aren't autoupgradeable?
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: Automatic Upgrade of modules

Post by Ted »

A module has to deliberatly opt out of auto upgrade.  It returns true by default.  Most likely because it involves some kind of manual action that you probably couldn't script anyway...
lemkepf
Forum Members
Forum Members
Posts: 163
Joined: Tue Oct 18, 2005 8:30 pm

Re: Automatic Upgrade of modules

Post by lemkepf »

Nice. :)
Post Reply

Return to “CMSMS Core”