Skip to content

polderknowledge/php-peek-lock

Repository files navigation

php-peek-lock

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

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.

Install

Via Composer

$ composer require polderknowledge/php-peek-lock

Usage

// 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');

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please report them via HackerOne instead of using the issue tracker or e-mail.

Community

We have an IRC channel where you can find us every now and then. We're on the Freenode network in the channel #polderknowledge.

Credits

License

Please see LICENSE.md for the license of this application.