aboutcoders/resource-lock-bundle

Simple resource locking

Maintainers

👁 aboutcoders

Package info

github.com/aboutcoders/resource-lock-bundle

Homepage

Type:symfony-bundle

pkg:composer/aboutcoders/resource-lock-bundle

Statistics

Installs: 25 523

Dependents: 1

Suggesters: 0

Stars: 4

Open Issues: 0

0.2.0 2021-02-18 19:36 UTC

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT c95af936d3e23fea42b52e06ca5cbff2f701f77b

  • Wojciech Ciolko <w.ciolko.woop@aboutcoders.com>

resourcelocklocker

This package is not auto-updated.

Last update: 2026-06-20 13:47:48 UTC


README

A Symfony bundle that provides resource lock implementation

👁 Build Status

Installation

Add the AbcResourceLockBundle to your composer.json file

{
 "require": {
 "aboutcoders/resource-lock-bundle": "dev-master"
 }
}

Include the bundle in the AppKernel.php class

public function registerBundles()
{
 $bundles = array(
 // ...
 new Abc\Bundle\ResourceLockBundle\AbcResourceLockBundle(),
 );

 return $bundles;
}

Configuration

Configure the bundle

# app/config/config.yml
abc_resource_lock:
 db_driver: orm

You can define custom managers with a custom prefix within the managers section

# app/config/config.yml
abc_resource_lock:
 db_driver: orm
 managers:
 my_manager:
 prefix: my_prefix
 another_manager:
 prefix: another_prefix

Usage

Use Lock manager to get, set or check locks:

$container->get('abc.resource_lock.lock_manager');

To retrieve the custom manager from the service container you have to specify it by its name:

$container->get('abc.resource_lock.lock_manager_my_manager');

License

The MIT License (MIT). Please see License File for more information.