aboutcoders/resource-lock-bundle
Symfony bundle providing a resource locking system backed by ORM. Configure a default lock manager and optional custom managers with prefixes, then fetch lock manager services from the container to set, get, and check locks across your app.
A Symfony bundle that provides resource lock implementation
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;
}
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
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');
The MIT License (MIT). Please see License File for more information.
How can I help you explore Laravel packages today?