loevgaard/locker

This package is abandoned and no longer maintained. The author suggests using the symfony/lock package instead.

PHP Process locker

v2.0.7 2017-02-16 13:43 UTC

This package is auto-updated.

Last update: 2019-04-10 13:12:05 UTC


README

Largely inspired by HopeUA/Locker

Usage

$locker = new FileLocker('large-process', ['lockDir' => '/tmp/lock']);
if ($locker->isLocked()) {
    die('Already locked');
}

$locker->lock();
... some code ...
$locker->unlock();