oliezekat / symfony-lock-filetouch
Files touch() storage implementation for the Symfony Lock component
Package info
github.com/oliezekat/symfony-lock-filetouch
pkg:composer/oliezekat/symfony-lock-filetouch
1.0.0
2026-07-19 19:39 UTC
Requires
- php: >=8.1
- symfony/lock: ^6.4
Requires (Dev)
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();