A PHP class which wraps flock()
You can use this to run jobs in the background and peek from the webserver if they are running.
Via Composer
$ composer require polderknowledge/php-peek-lock
// lock the file in a job to prevent race conditions between jobs:
$lock = new PeekLock('mylockfile.txt');
$lock->blockTillLock();
// check if the job is running from the webpage
$lock = new PeekLock('mylockfile.txt');
echo 'busy? ' . ($lock->isLocked() ? 'yes' : 'no');
Please see CHANGELOG for more information what has changed recently.
$ composer test
Please see CONTRIBUTING and CONDUCT for details.
If you discover any security related issues, please report them via HackerOne instead of using the issue tracker or e-mail.
We have an IRC channel where you can find us every now and then. We're on the Freenode network in the channel #polderknowledge.
Please see LICENSE.md for the license of this application.