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

ActiveLibrary

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 1mo 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 68% 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

4442d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/360d0049566ab4e5e1211feb2be81217f4bd86a8f048bbf35907139397fd0c41?d=identicon)[denheck](/maintainers/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

[bagisto/bagisto

Bagisto Laravel E-Commerce

26.2k161.6k7](/packages/bagisto-bagisto)[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

22.8k69.3k](/packages/grumpydictator-firefly-iii)[teamtnt/tntsearch

A fully featured full text search engine written in PHP

3.2k3.0M28](/packages/teamtnt-tntsearch)[unopim/unopim

UnoPim Laravel PIM

9.4k1.8k](/packages/unopim-unopim)[pdffiller/qless-php

PHP Bindings for qless

29113.2k1](/packages/pdffiller-qless-php)[concrete5/core

Concrete core subtree split

19159.3k48](/packages/concrete5-core)

PHPackages © 2026

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