PHPackages                             paysera/lib-lock-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. paysera/lib-lock-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

paysera/lib-lock-bundle
=======================

Provides utilities to organize Locks in your system

2.1.0(1y ago)015.3k8[1 PRs](https://github.com/paysera/lib-lock-bundle/pulls)MITPHPPHP &gt;=7.1

Since Oct 10Pushed 1y ago2 watchersCompare

[ Source](https://github.com/paysera/lib-lock-bundle)[ Packagist](https://packagist.org/packages/paysera/lib-lock-bundle)[ RSS](/packages/paysera-lib-lock-bundle/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (9)Dependencies (9)Versions (14)Used By (0)

lib-lock-bundle [![Build Status](https://camo.githubusercontent.com/a20e32abe65dae837cec1f4551e7920dcd6a606b061cb73958888618726c49fc/68747470733a2f2f7472617669732d63692e6f72672f706179736572612f6c69622d6c6f636b2d62756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/paysera/lib-lock-bundle)
====================================================================================================================================================================================================================================================================================================================

[](#lib-lock-bundle-)

Provides quick integration with `symfony/lock`

### Installation

[](#installation)

- Install package

```
composer require paysera/lib-lock-bundle
```

- Enable bundle

```
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            // ...
            new Paysera\Bundle\LockBundle\PayseraLockBundle(),
        ];

        // ...
    }
}
```

### Configuration

[](#configuration)

```
paysera_lock:
    ttl: 5 # integer, optional
    redis_client: # service id, required
```

`ttl` - time for locks TTL in seconds, default 5 seconds.

`redis_client` - service id for any `Redis` client service supported by [symfony/lock](https://symfony.com/doc/master/components/lock.html#lock-store-redis)

### Usage

[](#usage)

- `LockManager::createLock($identifier)` - creates lock **but not acquires it**
- `LockManager::acquire($lock)` - acquires lock or throws `LockAcquiringException` on failure
- `LockManager::createAccuired($identifier)` - creates **acquired** lock or throws `LockAcquiringException`
- `LockManager::release($lock)` - releases lock

#### Example

[](#example)

```
$lock = $this->lockManager->createLock($identifier);
try {
    $this->lockManager->acquire($lock);

    // do something after aquiring lock
} catch (LockAcquiringException $exception) {
    throw new Exception('...');
} finally {
    $lock->release();
}
```

OR

```
try {
    $lock = $this->lockManager->createAcquired($identifier);
} catch (LockAcquiringException $exception) {
    throw new Exception('...');
}

// do rest
```

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance41

Moderate activity, may be stable

Popularity25

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~233 days

Recently: every ~379 days

Total

11

Last Release

487d ago

Major Versions

0.2.1 → 1.0.02020-12-31

1.0.2 → 2.0.02022-01-10

PHP version history (2 changes)0.1.0PHP ^7.0

2.0.1PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/9d385187c2b529d5c1189dfc3763972f76738d24293593ff3db876fff82321db?d=identicon)[paysera.com](/maintainers/paysera.com)

---

Top Contributors

[![andriisobolatpaysera](https://avatars.githubusercontent.com/u/160000584?v=4)](https://github.com/andriisobolatpaysera "andriisobolatpaysera (9 commits)")[![mSprunskas](https://avatars.githubusercontent.com/u/4427922?v=4)](https://github.com/mSprunskas "mSprunskas (8 commits)")[![vbartusevicius](https://avatars.githubusercontent.com/u/7325630?v=4)](https://github.com/vbartusevicius "vbartusevicius (3 commits)")[![zelinskyi-paysera](https://avatars.githubusercontent.com/u/165694249?v=4)](https://github.com/zelinskyi-paysera "zelinskyi-paysera (1 commits)")

---

Tags

activebackendoss-librarypackagist

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/paysera-lib-lock-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/paysera-lib-lock-bundle/health.svg)](https://phpackages.com/packages/paysera-lib-lock-bundle)
```

###  Alternatives

[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k61](/packages/open-dxp-opendxp)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
