A PHP lock mechanism