brick / lock
Advisory locks library
Fund package maintenance!
BenMorel
Requires
- php: ^8.2
Requires (Dev)
- ext-pdo: *
- doctrine/dbal: 4.*
- phpstan/phpstan: 2.1.22
- phpunit/phpunit: ^11.5
- symfony/process: ^7.3
Conflicts
- doctrine/dbal: <4.0 || >=5.0
README
A PHP library to work with advisory locks.
Installation
This library is installable via Composer:
composer require brick/lock
Requirements
This library requires PHP 8.2 or later.
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
:
services: Brick\Lock\LockFactoryInterface: class: Brick\Lock\LockFactory Brick\Lock\LockDriverInterface: # choose the driver that corresponds to your database: class: Brick\Lock\Driver\MysqlLockDriver # class: Brick\Lock\Driver\PostgresLockDriver Brick\Lock\Database\ConnectionInterface: # choose the connection you want to use; in a typical Symfony project # with the Doctrine ORM, you'll probably want to use DoctrineConnection: class: Brick\Lock\Database\Connection\DoctrineConnection # class: Brick\Lock\Database\Connection\PdoConnection
You can now type-hint the Brick\Lock\LockFactoryInterface
service in your code and use it to create locks.