https://github.com/brick/lock
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/brick/lock
- Owner: brick
- License: mit
- Created: 2025-08-07T15:14:29.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-08-08T02:00:08.000Z (11 months ago)
- Last Synced: 2025-08-08T03:29:46.279Z (11 months ago)
- Language: PHP
- Size: 12.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
## Brick\Lock

A PHP library to work with advisory locks.
[](https://github.com/brick/lock/actions)
[](https://coveralls.io/github/brick/lock?branch=master)
[](https://packagist.org/packages/brick/lock)
[](https://packagist.org/packages/brick/lock)
[](http://opensource.org/licenses/MIT)
### Installation
This library is installable via [Composer](https://getcomposer.org/):
```bash
composer require brick/lock
```
### Requirements
This library requires PHP 8.2 or later.
### Project status & release process
While this library is still under development, it is well tested and considered stable enough to use in production
environments.
The current releases are numbered `0.x.y`. When a non-breaking change is introduced (adding new methods, optimizing
existing code, etc.), `y` is incremented.
**When a breaking change is introduced, a new `0.x` version cycle is always started.**
It is therefore safe to lock your project to a given release cycle, such as `^0.13`.
If you need to upgrade to a newer release cycle, check the [release history](https://github.com/brick/lock/releases)
for a list of changes introduced by each further `0.x.0` version.
### Overview
To be written.
### Use in a Symfony project
In a Symfony project using the Doctrine ORM, add the following config, typically in `config/services.yaml`:
```yaml
services:
Brick\Lock\LockFactoryInterface:
class: Brick\Lock\LockFactory
Brick\Lock\LockDriverInterface:
class: Brick\Lock\Driver\MysqlLockDriver
Brick\Lock\Database\ConnectionInterface:
class: Brick\Lock\Database\Connection\DoctrineConnection
```
You can now type-hint the `Brick\Lock\LockFactoryInterface` service in your code and use it to create locks.