[thelist] automatic code updates with PHP

Boris Mann boris at bmannconsulting.com
Tue Nov 12 14:18:07 CST 2002


On Tuesday, November 12, 2002, at 03:00 PM, Peter VanDijck wrote:

> There is no way users will give the provider of some handy software an
> SSH connection to their servers. Maybe to clarify: these are not web
> dev
> clients, these are people who will download some software and install
> it. (think Moveabletype)
> Peter

There are scripts that do what you suggest (automatic code update)
without eval() or anything else too complicated.

Some have update scripts that you run manually, checking a remote
website (usually the distributor of the code) to see if a version
number has changed.

Others have the update check built into some section of the web app --
like the admin section -- where a notice is displayed when an update is
found, along with a link to the list of changes, etc.

The first example that pops to mind is phpWebSite
(http://phpwebsite.appstate.edu/). It displays a notice in the admin
area such as "You are running version X.X.X. The current version is
X.X.Y. Click here to upgrade"

To implement this, it might mean having a folder where the "main" code
is that has to be chmod'd to allow access by the PHP/Webserver user
while the update happens, then changed back once the update is
complete. Gallery (http://gallery.sourceforge.net) does something
similar for setup -- you run a configure script to open permissions,
then run a secure script once you're done.

All in all, eval() and code in a database sounds like a terribly
convoluted way of doing things, never mind the problems with using
eval() in the first place.

--
Boris Mann
http://www.bmannconsulting.com




More information about the thelist mailing list