|
Posted by Joseph S. on 11/09/85 11:31
> Even if these events only occur once in a day, your database is
> immediately unsynchronised, and will probably require manual
> intervention to sort it out.
> IMO, a cron job is unnecessary. If you store the "check-out" time of
> each article in the DB, then you can perform time-out checks can be
> performed every time a user requests a PHP page.
> e.g. perform the following query at the top of every script:
>
> UPDATE articles
> SET isCheckedOut = 0
> WHERE (checkOutTime + X) < NOW()
>
> In practice, you can probably find ways to avoid doing this amount of
> processing in every script, but you get the general idea...
I had the same problem, too. I did the cleaning up process through a
php page that was called less frequently, but not as much to keep the
flag On for half a day. By estimate,(not reliable, but the best I could
think of at that time) this page would be run every half or one hour.
After doing all the work the page was supposed to do, it called this
little cleanup() function, something which it was not _supposed_ to do,
but did a good job of.
My question is, is there no daemon creating mechanism in PHP?
Any clues, googling gave this one useful result:
http://www.phpclasses.org/browse/package/2197.html
but not exactly what I am looking for -
making any script or function run continuously.
The only things we have continuously present is the superglobals
$_GET,$_POST,$_SERVER etc.- no code.
Joseph S.
[Back to original message]
|