2017 © Pedro Peláez
 

library php-fslock

A simple lock implementation using flock.

image

yriveiro/php-fslock

A simple lock implementation using flock.

  • Thursday, August 24, 2017
  • by yriveiro
  • Repository
  • 1 Watchers
  • 13 Stars
  • 28,072 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 22 % Grown

The README.md

FSLock

Build Status Coverage Status Total Downloads, (*1)

A simple lock implementation using flock., (*2)

NOTE: to use php-backoff with PHP 5.x please use the lastet release of branch 2.x, (*3)

Usage


use FSLock\FSLock; $lock = new FSLock('test'); if ($lock->acquire()) { // Critical code. $lock->release(); }

If you want to use a custom path to store the locks, you should instantiate the FSLock like that, (*4)

$lock = new FSLock('test', '/tmp/');

API

  • acquire: Acquires the lock, returns true if the operation was successful otherwise the return is false.
  • release: Releases the lock, returns true if the operation was successful otherwise the return is false.
  • id: returns the lock id.
  • getPath: returns the lock path

Install

The recommended way to install this package is through Composer., (*5)

composer require yriveiro/php-fslock:3.0.0

Tests

Tests are performed using the phpunit library, to run them:, (*6)

php vendor/bin/phpunit tests

License

FSLock is licensed under MIT license., (*7)

The Versions

24/08 2017

dev-master

9999999-dev

A simple lock implementation using flock.

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Yago Riveiro

php lock flock lock file

01/02 2016

2.0.0

2.0.0.0

A simple lock implementation using flock.

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Yago Riveiro

php lock flock lock file

29/09 2013

0.1

0.1.0.0

A simple lock implementation using flock.

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Yago Riveiro

php lock flock lock file