diff --git a/CHANGELOG.md b/CHANGELOG.md index c8a6dc3..a488a70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## 3.0.0 - 2018-10-01 + +- Bump minimal PHP version to 7.x. +- Declare explicit return values in methods. +- Destroy method removed, after call destroy method, the instance is useless and +it can not be initialized again. +- Allow lock bucket to be configurable when FSLock instance it's declared. + + ## 2.0.0 - 2016-01-31 ### Added diff --git a/README.md b/README.md index c7f8fd2..55e51d2 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ A simple lock implementation using flock. +*NOTE:* to use php-backoff with PHP 5.x please use the lastet release of branch 2.x + # Usage ```PHP @@ -21,11 +23,16 @@ if ($lock->acquire()) { } ``` +If you want to use a custom path to store the locks, you should instantiate the FSLock like that + +```PHP +$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_. -- `destroy`: allows manually destruction of the lock. Internally release the lock and perform a cleanup operation. It's the same process used by the `__destruct` magic method. - `id`: returns the lock id. - `getPath`: returns the lock path @@ -34,7 +41,7 @@ if ($lock->acquire()) { The recommended way to install this package is through [Composer](http://getcomposer.org/download/). ```sh -composer require yriveiro/php-fslock:2.0.0 +composer require yriveiro/php-fslock:3.0.0 ``` # Tests