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

ActiveLibrary[Caching](/categories/caching)

v10086/redis-lock
=================

Redis分布式锁(Distributed locks)

v1.0(3y ago)1521Apache-2.0PHPPHP &gt;=7.0

Since Mar 7Pushed 3y ago1 watchersCompare

[ Source](https://github.com/v10086/redis-lock)[ Packagist](https://packagist.org/packages/v10086/redis-lock)[ RSS](/packages/v10086-redis-lock/feed)WikiDiscussions master Synced today

READMEChangelog (1)DependenciesVersions (2)Used By (1)

📃 开源协议 Apache License Version 2.0 see

简介
==

[](#简介)

Redis分布式锁(Distributed locks) 用Redis实现一个分布式锁管理。

版本说明
----

[](#版本说明)

PHP7.0+版本 必须安装phpredis拓展

安装教程
----

[](#安装教程)

composer require v10086/redis-lock:v1.0

使用示例
----

[](#使用示例)

```
        //\v10086\RedisLock::$redisHandler=\v10086\Redis::connection('default'); 设置可用的redis操作句柄
        //上锁
        $lock_key='10086';
        $lock_token=uniqid();
        $res = \v10086\RedisLock::lock($lock_key,$lock_token);
        if($res!=true){
            //锁被其它事务占用 上锁失败 返回提示
            return;
        }
        //做点其它事务处理，完成后解锁
        \v10086\RedisLock::unlock($lock_key,$lock_token);

```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity40

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

Unknown

Total

1

Last Release

1160d ago

### Community

Maintainers

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

---

Top Contributors

[![v10086](https://avatars.githubusercontent.com/u/15503470?v=4)](https://github.com/v10086 "v10086 (15 commits)")

---

Tags

distributedlockredis-lockphpredisphpredisdistributed locks

### Embed Badge

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

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

###  Alternatives

[awssat/laravel-visits

Laravel Redis visits counter for Eloquent models

975163.6k2](/packages/awssat-laravel-visits)[cache/redis-adapter

A PSR-6 cache implementation using Redis (PhpRedis). This implementation supports tags

523.9M27](/packages/cache-redis-adapter)[swoft/redis

swoft redis component

12168.4k16](/packages/swoft-redis)[eftec/cacheone

A Cache library with minimum dependency

103.5k4](/packages/eftec-cacheone)

PHPackages © 2026

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