PHPackages                             lyoshenka/php-simple-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. lyoshenka/php-simple-lock

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

lyoshenka/php-simple-lock
=========================

A simple PHP advisory lock implementation. Uses flock() internally.

1.0(11y ago)142PHPPHP &gt;=5.3.3

Since Jan 19Pushed 11y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (2)Used By (0)

php-simple-lock
===============

[](#php-simple-lock)

Install
-------

[](#install)

```
"require": {
  "lyoshenka/php-simple-lock": "~1.0"
}
```

or from the command-line:

```
composer require lyoshenka/php-simple-lock

```

Usage
-----

[](#usage)

```
use SimpleLock\Lock;

$lock = Lock::acquire('lockname');
if ($lock)
{
  // lock acquired. protected code goes here.

  Lock::release($lock);
}
```

If you want to change the location where lockfiles are stored:

```
Lock::setLockDir('/path/to/lock/dir');
```

Bugs/Fixes
----------

[](#bugsfixes)

File issues here, submit pull requests, or email me:

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

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

Unknown

Total

1

Last Release

4128d ago

### Community

Maintainers

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

---

Top Contributors

[![lyoshenka](https://avatars.githubusercontent.com/u/362784?v=4)](https://github.com/lyoshenka "lyoshenka (2 commits)")

---

Tags

phplockinglocklockfile

### Embed Badge

![Health badge](/badges/lyoshenka-php-simple-lock/health.svg)

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

###  Alternatives

[imanghafoori/laravel-anypass

A minimal yet powerful package to help you in development.

21421.6k](/packages/imanghafoori-laravel-anypass)[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)
