Re: [PHPLIB] Sneaky Use of prepend.php3 From: Massimiliano Masserelli (negro <email protected>)
Date: 11/23/99

On Tue, Nov 23, 1999 at 08:56:58AM -0800, Bob Bowker wrote:

 BB> Neat ... but the same issue arises. If prepend.php3 sends a "Sorry
 BB> we're closed" page of HTML to the browser, either because it finds
 BB> the DBLOCK file or because it's been overwritten, does this affect
 BB> the script that's running the MySQL update?

Nope, it should not. The script I gave you as example is part of a script
I use to reload a complete db when the new version is sent to the script
via e-mail. The DBLOCK is used also to prevent conflicts between two or
more concurrent e-mails. Oh, and since I check for the DBLOCK before
calling page_open, when the update is over the user may just hit reload
and continue his browsing where he left (form input included).
 
 BB> Maybe the way to get around this is to copy the contents of the
 BB> *real* prepend.php3 into the top of the DB Update script, then
 BB> overwrite prepend.php3, then do the update, then re-write
 BB> prepend.php3, then exit ...? But then how do I even start this script
 BB> without prepend.php3?

I don't think messing with prepend.php3 is a "good thing". Moreover, the
copy is non-atomic, and may cause harm in case of heavy load of the site.
The method I proposed is non-atomic, too, but much more "rapid" than moving
two files. You could also use a database lock (ie "lock table foo") before
updating, then checking for the lock...
 
 BB> I'm still not absolutely sure if there's a problem to get around,
 BB> although our tests so far show that something strange is happening
 BB> ...

I agree, there's something strange...

Bye.

--
     Massimiliano Masserelli       |     URL:    http://www.interim.it/
     Internet Images S.r.l.        |     Tel:    +39-051-3390671
     vicolo Viazzolo, 3            |     Fax:    +39-051-557890
     40124 - Bologna - Italy       |
-------------------------------------------------------------------------------
The use of money is all the advantage there is to having money.
		-- B. Franklin
-
PHP3 Base Library Mailing List. Send messages to <phplib <email protected>>.
To unsubscribe, send "unsubscribe" to <phplib-request <email protected>> in
the body, not the subject, of your message.