aharavenka / filelock
Simple php library providing OOP-interface to file locks.
1.0.0
2025-03-18 18:50 UTC
Requires
- php: ^5.3|^7.0|^8.0
Requires (Dev)
- phpunit/phpunit: ^4.8 | ^6.5
- satooshi/php-coveralls: >=0.7.1 <2.0
- squizlabs/php_codesniffer: ^2.3
This package is auto-updated.
Last update: 2025-07-18 19:37:59 UTC
README
Simple php library providing OOP-interface to file locks.
Installation
composer require dorantor/filelock
Usage
<?php // create lock object $lock = new \Dorantor\FileLock('path/to/file'); // ..and work with it if ($lock->acquire()) { // file is locked $lock->release(); } // ..or it could be if (!$lock->acquire()) { // failed with lock return; } // file was locked $lock->release();
Credits
Idea, interfaces and some code shamelessly taken from benconstable/lock.