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

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

wv/lock
=======

钱包锁

00PHP

Since Oct 22Pushed 6y ago1 watchersCompare

[ Source](https://github.com/Mr-wangwei/lock)[ Packagist](https://packagist.org/packages/wv/lock)[ RSS](/packages/wv-lock/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (1)Used By (0)

安装
--

[](#安装)

```
composer require "wv/lock";
```

使用
--

[](#使用)

```
use Wei\Lock\Application;

$config = [
    'cache' => [
        'default' => 'redis',
        'stores' => [
            'file' => [
                 'driver' => 'file',
                 'patch'  => __DIR__ . DIRECTORY_SEPARATOR . 'cache',
            ],
            'memcached' => [
                 'server' => '127.0.0.1',
                 'port'   => 11211,
            ],
            'redis' => [
                 'driver'   => 'predis',
                 'host'     => '127.0.0.1',
                 'password' => null,
                 'port'     => 6379,
                 'database' => 0,
            ],
        ],
    ],
];

$app = new Application($config);

//上锁
try {
    $app->lock->setLock('key', 7200, 0);
} catch (\Exception $e) {
    //捕捉异常
}

//释放锁
$app->lock->releaseLock('key');
```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b374242b3b5fdc4b767c99a2f77851809b9aa507789df8a21fc9eae09716b5a?d=identicon)[mr-wei](/maintainers/mr-wei)

---

Top Contributors

[![Mr-wangwei](https://avatars.githubusercontent.com/u/46190162?v=4)](https://github.com/Mr-wangwei "Mr-wangwei (16 commits)")

### Embed Badge

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

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

###  Alternatives

[tatter/alerts

Lightweight user alerts for CodeIgniter 4

4072.4k6](/packages/tatter-alerts)[humanmade/altis-reusable-blocks

Adds functionality to reusable blocks to enhance their usage.

11183.7k5](/packages/humanmade-altis-reusable-blocks)[yiibr/yii2-correios

Locates an address in Brazil by postal code

1214.2k](/packages/yiibr-yii2-correios)

PHPackages © 2026

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