PHPackages                             dennis/php-redis-lock - 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. dennis/php-redis-lock

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dennis/php-redis-lock
=====================

v0.2.4(12y ago)46.3k2MITPHP

Since Feb 12Pushed 12y ago2 watchersCompare

[ Source](https://github.com/denheck/php-redis-lock)[ Packagist](https://packagist.org/packages/dennis/php-redis-lock)[ RSS](/packages/dennis-php-redis-lock/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (2)Versions (9)Used By (0)

php-redis-lock
==============

[](#php-redis-lock)

Connecting to Redis:
--------------------

[](#connecting-to-redis)

```
RedisLock::connect('tcp://host:port');

```

Or to just connect to localhost and default port:

```
RedisLock::connect();

```

Acquiring a Lock:
-----------------

[](#acquiring-a-lock)

```
$lock = RedisLock::lock('resource');
if($lock) {
    doSomething();
}

```

This will attempt to acquire a lock for the named resource. If successful, the return value is a RedisLock object. If the resource was already locked, the return value will be +false+.

Releasing the Lock:
-------------------

[](#releasing-the-lock)

```
RedisLock::release($lock);

```

Make sure to release the lock once you're done with it, so another client can acquire it.

Lock Expiration
---------------

[](#lock-expiration)

If your client acquires a lock and then dies before releasing it, the lock will expire after a certain amount of time (default 5 minutes). You can set your own lock expiration when acquiring the lock like so: $lock = RedisLock::lock('resource', $expiration\_in\_seconds);

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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 ~4 days

Total

8

Last Release

4495d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/235116?v=4)[Dennis Heckman](/maintainers/denheck)[@denheck](https://github.com/denheck)

---

Top Contributors

[![denheck](https://avatars.githubusercontent.com/u/235116?v=4)](https://github.com/denheck "denheck (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dennis-php-redis-lock/health.svg)

```
[![Health](https://phpackages.com/badges/dennis-php-redis-lock/health.svg)](https://phpackages.com/packages/dennis-php-redis-lock)
```

###  Alternatives

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

23.8k69.4k](/packages/grumpydictator-firefly-iii)[unopim/unopim

UnoPim Laravel PIM

10.5k2.2k](/packages/unopim-unopim)[splitsoftware/split-sdk-php

Split SDK for PHP

161.3M2](/packages/splitsoftware-split-sdk-php)

PHPackages © 2026

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