Hi everyone,
I am building a remote control panel which will be licensed out to clients.
There obviously be updates, bug fixes andnew features come over time, and I am looking for a way to have an update button in their admin panel.
This will then automated the process of downloading and installing the required files.
I was just wondering what you think are the best techniques for this kind system.
From a few quick googles I have found very little documentation about this kind of process.
Some potential problems I were thinking of:
can you update php files while they might actually be in use?
should a separated system/service be used?
suppose clients may be missing 1+ updates, in which case they would need applying first..
I expect your list may go even further...
Cheers!
Update system for PHP script.
Moderator: General Moderators
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Re: Update system for PHP script.
That is a very good possibility, yes. Especially when you have more than a single client using the same software.can you update php files while they might actually be in use?
I upload the latest copy as a temp directory and then route requests to a temp down page, rename the existing folder to .old and the new folder to the existing name. When users have tested the software thouroughly, I delete the old folder in 5 days.
Cheers,
Alex
Re: Update system for PHP script.
So when I present the user with a "Click Here to Update" button...
I take it the best option would be to have this trigger a shell script which will WGET and untar the update files?
I take it the best option would be to have this trigger a shell script which will WGET and untar the update files?
-
Bruno De Barros
- Forum Commoner
- Posts: 82
- Joined: Mon May 12, 2008 8:41 am
- Location: Ireland
Re: Update system for PHP script.
If you have root access, sure. Otherwise, use FTP.
By the way, don't forget about database updates (if you need to do any). Lately, I've been through this problem with some of the scripts I've deployed for a few clients, and I think I'm just going to develop something to help remotely deploy scripts, along with their databases, and find ways to keep them updated properly.
By the way, don't forget about database updates (if you need to do any). Lately, I've been through this problem with some of the scripts I've deployed for a few clients, and I think I'm just going to develop something to help remotely deploy scripts, along with their databases, and find ways to keep them updated properly.
- kaisellgren
- DevNet Resident
- Posts: 1675
- Joined: Sat Jan 07, 2006 5:52 am
- Location: Lahti, Finland.
Re: Update system for PHP script.
Lock the files that you update, update them, and release the lock. Maybe setting some global option "maintenance" to true and show the visitors that there's an ongoing update. Also, it would be a good idea to calculate a hash of the update files on your central server, and then recalculate the hash of the downloaded update to see if it matches.
Re: Update system for PHP script.
Don't forget about the configuration files where you cannot simply replace an old file with a new one. Here you should have a tool that would take both of the versions, compare them and rewrite the old settings to the new file before deploying it.
Re: Update system for PHP script.
Thanks for the tip's people, going to have a go at trying a few methods to see what I like the best.
Any more ideas would be great
Any more ideas would be great