[thelist] automatic code updates with PHP

Anthony Baratta Anthony at Baratta.com
Mon Nov 11 15:48:00 CST 2002


At 11:50 AM 11/11/2002, Peter VanDijck wrote:
>Hi all,
>I'm developing a web application (installed on the client's server) in
>PHP. I'm considering putting all the code in the database (using PHP's
>eval() function) and then building inn a function so the code can
>automatically import new updates as they are released, a bit like
>Windows XP does. Any wise stories I should hear? Is this a bad idea? Why
>isn't this ever done (I have never seen it)? Do developers know
>something I don't?

Peter...

Here's my 1/100th of a Euro:

First of the eval() function is very "expensive". Should be used as little
as possible.

Second, I would create a common code library of functions and as well as a
common directory structure to hold those libraries. This directory
structure can be part of the web root, or not. Then as you build your list
of clients you could use a cron job, or a manually activated PHP page to
update the common code libraries from your central server.

However, the biggest problem with automatic updates is introducing a bug
that is replicated to all your sites. Or adding something that works for 9
sites, and crashes the 10th. Be wary of auto-updating.

What you might consider is maintaining a DB or Excel Spreadsheet of the
code versions of the libraries used at each client site, and update them to
the latest versions as you revisit them for other updates. Or maybe get
your clients to pay a monthly/quarterly/yearly subscription for the latest
code updates and manually update the sites as your subscription contract
outlines.

HTH, or at least does not hurt.
--
Anthony Baratta
President
Keyboard Jockeys

"Conformity is the refuge of the unimaginative."




More information about the thelist mailing list