oliezekat/symfony-lock-filetouch

Files touch() storage implementation for the Symfony Lock component

Maintainers

Package info

github.com/oliezekat/symfony-lock-filetouch

pkg:composer/oliezekat/symfony-lock-filetouch

Transparency log

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2026-07-19 19:39 UTC

This package is auto-updated.

Last update: 2026-07-19 19:47:23 UTC


README

A storage implementation for the Symfony Lock component, based on the PersistingStoreInterface which uses touch(), file_exists(), or filemtime() on empty files within a dedicated directory.

It supports locking, blocking mode, and auto-release across different applications, provided they use the same directory and the same maximum lifetime.

Lock refresh() requires a TTL that is less than or equal to the maximum lifetime.

Usage

use Oliezekat\SymfonyLockFileTouch\Store;
use Symfony\Component\Lock\Factory;

$store = new Store(/* $locksDirPath, $maxLifeTime */);
$factory = new Factory($store);

$lock = $factory->createLock('test');
if ($lock->acquire()) {
    ...
    $lock->refresh();
}
...
$lock->release();

Resources