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

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

kaadon/lock
===========

kaadon lock for PHP

1.0.1(1y ago)061Apache-2.0PHPPHP &gt;=7.4

Since Sep 26Pushed 1y ago1 watchersCompare

[ Source](https://github.com/kaadon/KaadonLock)[ Packagist](https://packagist.org/packages/kaadon/lock)[ Docs](http://developer.kaadon.com/)[ RSS](/packages/kaadon-lock/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (6)Used By (0)

KaadonLock
==========

[](#kaadonlock)

PHP阻塞锁和非阻塞锁机制，内置解决并发锁重复执行的方案。目前支持文件、Redis、Memcached。

composer安装
----------

[](#composer安装)

1.1 在你项目中的安装composer包：

```
composer require kaadon/lock
```

1.2 使用composer命令行安装：

```
// 文件
$fp = fopen('1.txt', 'w+');
$lock = new \Yurun\Until\Lock\File('我是锁名称', $fp);
$lock->lock();
// 做一些事情
$lock->unlock();
fclose($fp);

// redis、memcached同理
$redis = new \Redis;
$redis->connect($host, $port, $timeout);
$lock = new \Yurun\Until\Lock\Redis('我是锁名称', $$redis);
$lock->lock();
// 做一些事情
$lock->unlock();
redis->close();
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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

Total

5

Last Release

660d ago

Major Versions

v0.0.5 → 1.0.12024-07-27

PHP version history (2 changes)v0.0.4PHP &gt;=7.1

1.0.1PHP &gt;=7.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/58987658?v=4)[Kaadon](/maintainers/kaadon)[@kaadon](https://github.com/kaadon)

---

Top Contributors

[![kaadon](https://avatars.githubusercontent.com/u/58987658?v=4)](https://github.com/kaadon "kaadon (7 commits)")

---

Tags

lockkaadon

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[zerkalica/semaphore

This library provides an api for semaphore acquire and release

1119.0k1](/packages/zerkalica-semaphore)[nabao/laravel-lock

高性能, 分布式, 并发抢占锁, 队列锁

271.5k](/packages/nabao-laravel-lock)[pudongping/hyperf-wise-locksmith

A mutex library provider for the Hyperf framework, designed to enable serialized execution of PHP code in high-concurrency scenarios.

106.3k2](/packages/pudongping-hyperf-wise-locksmith)

PHPackages © 2026

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