PHPackages                             toanppp/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. [Caching](/categories/caching)
4. /
5. toanppp/php-redis-lock

ActiveLibrary[Caching](/categories/caching)

toanppp/php-redis-lock
======================

Access synchronization mechanism.

1.1.0(3y ago)07MITPHPPHP &gt;=7.4

Since May 15Pushed 3y ago1 watchersCompare

[ Source](https://github.com/toanppp/php-redis-lock)[ Packagist](https://packagist.org/packages/toanppp/php-redis-lock)[ RSS](/packages/toanppp-php-redis-lock/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

PHP Redis Lock
==============

[](#php-redis-lock)

About
-----

[](#about)

Access synchronization mechanism.

Installation
------------

[](#installation)

```
composer require toanppp/php-redis-lock
```

Methods
-------

[](#methods)

### RedisLock :: getInstance ( `string` host, `int` port )

[](#redislock--getinstance--string-host-int-port-)

Create or get singleton instance of RedisLock.

```
$redisLockInstance = RedisLock::getInstance('127.0.0.1', 6379);
```

### RedisLock :: acquire ( `string` key, `string` | `null` type = `null` )

[](#redislock--acquire--string-key-string--null-type--null-)

Lock a key, with or without type.

```
$redisLockInstance->acquire('key');
```

### RedisLock :: release ( `string` key )

[](#redislock--release--string-key-)

Release a key.

```
$redisLockInstance->release('key');
```

### RedisLock :: releaseByType ( `string` type )

[](#redislock--releasebytype--string-type-)

Release a key by type.

```
$type = 'uniqueKey';
$redisLockInstance->acquire(uniqid(), $type);

$redisLockInstance->releaseByType($type);
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

Total

2

Last Release

1455d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e44080cbf69e61c321bb3d1405c285271daa2944f392822005f9637792915ac9?d=identicon)[toanppp](/maintainers/toanppp)

---

Top Contributors

[![toanppp](https://avatars.githubusercontent.com/u/94856781?v=4)](https://github.com/toanppp "toanppp (6 commits)")

---

Tags

distributed-lockphpredis

### Embed Badge

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

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

###  Alternatives

[predis/predis

A flexible and feature-complete Redis/Valkey client for PHP.

7.8k305.7M2.4k](/packages/predis-predis)[snc/redis-bundle

A Redis bundle for Symfony

1.0k39.4M67](/packages/snc-redis-bundle)[react/cache

Async, Promise-based cache interface for ReactPHP

444112.4M40](/packages/react-cache)[wp-media/wp-rocket

Performance optimization plugin for WordPress

7431.3M3](/packages/wp-media-wp-rocket)[illuminate/cache

The Illuminate Cache package.

12835.6M1.4k](/packages/illuminate-cache)[colinmollenhour/php-redis-session-abstract

A Redis-based session handler with optimistic locking

6325.6M14](/packages/colinmollenhour-php-redis-session-abstract)

PHPackages © 2026

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