jigius / flock
Simple lock file management class.
Installs: 25
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/jigius/flock
Requires
- php: >=5.3.0
Requires (Dev)
- mikey179/vfsstream: 1.2.*
- phpunit/phpunit: 3.7.*
This package is auto-updated.
Last update: 2025-09-22 19:03:23 UTC
README
Simple process lock management library.
Installation
Installation is best managed via Composer.
{ "require": { "jigius/flock": "1.0.*" } }
Or:
composer require jigius/flock=1.0.*
Usage
<?php $lock = new \Jigius\FLock\FLock("lock-name", "/path/to/lock/folder"); if ($lock->acquire()) { // Do work here } else { die ("Unable to acquire lock! Make sure no other process is running!"); } $lock->release();
Methods
- bool \Jigius\FLock\FLock::__construct( string $name [, string $path = null ] )
- object \Jigius\FLock\FLock::create( string $name [, string $path = null ] )
- bool \Jigius\FLock\FLock::acquire( [ bool $block = false ] )
- bool \Jigius\FLock\FLock::release()
- bool \Jigius\FLock\FLock::check()
- string \Jigius\FLock\FLock::getOwnerPid()