Skip to content

jigius/flock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jigius FLock

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()

About

Simple lock file management library

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages