PHP 8.5.0 Alpha 2 available for testing

Voting

: zero minus zero?
(Example: nine)

The Note You're Voting On

brospam at gmail dot com
11 years ago
My lockfile system

<?php
function isLocked(){
if(
file_exists(LOCK_FILE)) {
$lockingPID = trim(file_get_contents(LOCK_FILE));
$test=trim(`ps -p $lockingPID -o pid=`);
if(!empty(
$test)) return true;
echo
"Removing stale lock file.\n";
unlink(LOCK_FILE);
}
file_put_contents(LOCK_FILE, getmypid()."\n");
return
false;
}
?>

<< Back to user notes page

To Top