A class to handle a lockfile for a running process. The idea is you
create one of these for a process each time you run it. If the lockfile already exists, then
Located in /lockfile-defs.php (line 71)
Latest error code
True if the lockfile exists
Name of freeze lockfile to create (internal)
Lockfile age at which we should stop trying to kill hung process
True if the freeze lockfile exists
Lockfile age at which we should assume process is hung
Name of the lockfile to create
Minutes process has been locked for
Latest error message
Process ID of process lockfile is for
Make a new lockfile handler object.
Create the lockfile. We only do this, obviously, if it doesn't already exist. If it DOES exist, then we make a lot of checks. If time-limits are set we possibly try to kill the process and remove the lockfile before creating our new one.
If we created a lockfile then we return true, and this measn the calling process should feel free to run. If we return false, then either the lock is valid, or an error condition is present, and the calling process should about/exit without running.
Remove the lockfile. Can't do this if the lock is frozen, which is deemed to require manual intervention.
Set the time limits. Some commonsense has to be applied here. You
should pick times, in mins, which are sensible according to how frequently you are going to be checking the lockfiles. If, for example you pick killmins=5 and freezemins=10 and only run this every hour, then you will never give it chance to kill a hung process between the 5 and 10 mins mark. A better choice for that would be killmins=30 freezemins=130.
Documentation generated by phpDocumentor 1.3.0RC3