dorantor / filelock
Simple php library providing OOP-interface to file locks.
Installs: 9 424
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 2
Open Issues: 3
Requires
- php: ^5.3|^7.0
This package is auto-updated.
Last update: 2024-07-29 04:17:03 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.