Symfony Resource Lock Bundle
A Symfony bundle that provides resource lock implementation, (*1)
, (*2)
Installation
Add the AbcResourceLockBundle to your composer.json
file, (*3)
{
"require": {
"aboutcoders/resource-lock-bundle": "dev-master"
}
}
Include the bundle in the AppKernel.php class, (*4)
public function registerBundles()
{
$bundles = array(
// ...
new Abc\Bundle\ResourceLockBundle\AbcResourceLockBundle(),
);
return $bundles;
}
Configuration
Configure the bundle, (*5)
``` yaml, (*6)
app/config/config.yml
abc_resource_lock:
db_driver: orm, (*7)
You can define custom managers with a custom prefix within the `managers` section
``` yaml
# 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:, (*8)
``` php
$container->get('abc.resource_lock.lock_manager');, (*9)
To retrieve the custom manager from the service container you have to specify it by its name:
``` php
$container->get('abc.resource_lock.lock_manager_my_manager');
License
The MIT License (MIT). Please see License File for more information., (*10)