Skip to content

Commit

Permalink
Update change log and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
yriveiro committed Oct 1, 2018
1 parent 793e038 commit ae12605
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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
Expand Down

0 comments on commit ae12605

Please sign in to comment.