Page 1 of 1

Auto Update

Posted: Sun Aug 16, 2009 9:20 pm
by twiggy
A feature that would be good is an auto-update script. Something in the admin panel checks to see if the version being run is the current one and if not then one click update button to do all the work ;D

Just an idea, I have seen similar scripts in other PHP programmes so I guess it possible.

Re: Auto Update

Posted: Mon Aug 17, 2009 8:54 am
by jamieleshaw
This would be great.

Re: Auto Update

Posted: Mon Aug 17, 2009 6:47 pm
by twiggy
Yes it would be grate but it all depends on the developer, I would imagine its quite a large task.

But this would be an awesome feature for opencart and can bring in less experienced users and make opencart grow. Also keeps opencart safer knowing people have the latest bug free version. Also saves the rest of us time to run our shops!

Re: Auto Update

Posted: Mon Aug 17, 2009 8:14 pm
by Qphoria
The problem is how to do it.

SMF uses its plugin system, which isn't "hook" based but instead actually edits the core files based on commands from an XML file. It seems to work, but looks for specific strings for updates

I also had an idea to use .patch files that are generated from udiff to work with a phppatching system. This way when a mod is made, it can generate .patch files automatically and then be executed on the server.

Re: Auto Update

Posted: Tue Aug 18, 2009 5:27 am
by twiggy
so.....

You reckon its possible? ;D

Be an awesome feature for lazy people like my self + people who are scared of computers :)

Re: Auto Update

Posted: Tue Aug 18, 2009 9:06 am
by Qphoria
Well look.. I've never tried to update OpenCart 1.x personally because I haven't had the need. But looking at the steps involved, I really can't believe how much trouble people are having with this.

This is definitely a trick that OpenCart could learn from what I did with ChromiumCart.

I made 2 sql files.
default.sql & upgrade.sql

default.sql is the basic stuff that comes with the first version.... first install
upgrade.sql is the stuff that is added subsequently.

BOTH files are run on fresh install, this allows the new installs to get the basics and the updates
Only the upgrade.sql file is run for upgrades between versions.

So now all changes to the db will go here. It also uses full proper sql so that it can even be run standalone in phpmyadmin. In this file I do all my changes, step by step.

So for example, when I released version 0.8.0
1. People did a full install which ran the default.sql & upgrade.sql
2. Upgrade.sql was blank at this time since it was the first version.
Then as I coded 0.8.1, I made changes to the database to add fields to the product table for dimensions, add tables for special products, related products etc.
So in my upgrade.sql file, I added all these steps, and labeled what each step did and what version of the cart it was for.
Then I set the script to autoexecute during the upgrade process, which was simply logging into the admin panel after uploading the files. The script checks the version in the db vs the version in the files and if they don't match, it runs the upgrade script. Simple! It runs the sql and did whatever else it needed so that people didn't have to be involved.
And since I patched the existing db, there was no backup/restore problems. It also meant that it was a static process that I controlled. So it was the same for everyone.

I welcome you to download the latest version of Chromium and look at the install/upgrade.sql file. It's extremely simple and easy to follow each step and it works 100% of the time. This could apparently be very useful in OpenCart as well.

Re: Auto Update

Posted: Tue Aug 18, 2009 9:16 am
by jamieleshaw
This would be very useful. :)
As I'm scared of stuffing it up ;)

Re: Auto Update

Posted: Tue Aug 18, 2009 8:15 pm
by Leon
Qphoria wrote:Well look.. I've never tried to update OpenCart 1.x personally because I haven't had the need. But looking at the steps involved, I really can't believe how much trouble people are having with this.

This is definitely a trick that OpenCart could learn from what I did with ChromiumCart.

I made 2 sql files.
default.sql & upgrade.sql

default.sql is the basic stuff that comes with the first version.... first install
upgrade.sql is the stuff that is added subsequently.

BOTH files are run on fresh install, this allows the new installs to get the basics and the updates
Only the upgrade.sql file is run for upgrades between versions.

So now all changes to the db will go here. It also uses full proper sql so that it can even be run standalone in phpmyadmin. In this file I do all my changes, step by step.

So for example, when I released version 0.8.0
1. People did a full install which ran the default.sql & upgrade.sql
2. Upgrade.sql was blank at this time since it was the first version.
Then as I coded 0.8.1, I made changes to the database to add fields to the product table for dimensions, add tables for special products, related products etc.
So in my upgrade.sql file, I added all these steps, and labeled what each step did and what version of the cart it was for.
Then I set the script to autoexecute during the upgrade process, which was simply logging into the admin panel after uploading the files. The script checks the version in the db vs the version in the files and if they don't match, it runs the upgrade script. Simple! It runs the sql and did whatever else it needed so that people didn't have to be involved.
And since I patched the existing db, there was no backup/restore problems. It also meant that it was a static process that I controlled. So it was the same for everyone.

I welcome you to download the latest version of Chromium and look at the install/upgrade.sql file. It's extremely simple and easy to follow each step and it works 100% of the time. This could apparently be very useful in OpenCart as well.
I hope to see it done this way in the next release

Re: Auto Update

Posted: Wed Aug 19, 2009 3:19 pm
by smallpox
please.