PHPackages                             polderknowledge/php-peek-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. polderknowledge/php-peek-lock

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

polderknowledge/php-peek-lock
=============================

A PHP library which acts as a wrapper around flock() to provide an interprocess lock.

1.0.1(8y ago)18229[1 issues](https://github.com/polderknowledge/php-peek-lock/issues)MITPHPPHP &gt;=7.0

Since Jul 7Pushed 8y ago7 watchersCompare

[ Source](https://github.com/polderknowledge/php-peek-lock)[ Packagist](https://packagist.org/packages/polderknowledge/php-peek-lock)[ Docs](https://polderknowledge.com)[ RSS](/packages/polderknowledge-php-peek-lock/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (2)Versions (3)Used By (0)

php-peek-lock
=============

[](#php-peek-lock)

[![Latest Version on Packagist](https://camo.githubusercontent.com/42bc6dd82e3b2ed48d6aa308052e6b07020bc0b18604725161aa90723eb0b8eb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706f6c6465726b6e6f776c656467652f7068702d7065656b2d6c6f636b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/polderknowledge/php-peek-lock)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/a134f4288e588d5dad9aff3d76365d66f624191fb16ccef9c308af27530b2dac/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f706f6c6465726b6e6f776c656467652f7068702d7065656b2d6c6f636b2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/polderknowledge/php-peek-lock)[![Coverage Status](https://camo.githubusercontent.com/f63d8c0b0f8dbb59c2b35a0f6261c83effbd269564b3a9455cc4e63dd3b7964d/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f706f6c6465726b6e6f776c656467652f7068702d7065656b2d6c6f636b2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/polderknowledge/php-peek-lock/code-structure)[![Quality Score](https://camo.githubusercontent.com/a60ea69f210ee2b74c6cf8dc1e7ae6f9121c12d00df815ef0b450f9616ec43ad/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f706f6c6465726b6e6f776c656467652f7068702d7065656b2d6c6f636b2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/polderknowledge/php-peek-lock)[![Total Downloads](https://camo.githubusercontent.com/8443e1c2e6b1dc2fbea33948dc39e5906f07889b66907ae3109067dffbcb43c4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f706f6c6465726b6e6f776c656467652f7068702d7065656b2d6c6f636b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/polderknowledge/php-peek-lock)

A PHP class which wraps flock()

You can use this to run jobs in the background and peek from the webserver if they are running.

Install
-------

[](#install)

Via Composer

```
$ composer require polderknowledge/php-peek-lock
```

Usage
-----

[](#usage)

```
// lock the file in a job to prevent race conditions between jobs:
$lock = new PeekLock('mylockfile.txt');
$lock->blockTillLock();

// check if the job is running from the webpage
$lock = new PeekLock('mylockfile.txt');
echo 'busy? ' . ($lock->isLocked() ? 'yes' : 'no');
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please report them via [HackerOne](https://hackerone.com/polderknowledge)instead of using the issue tracker or e-mail.

Community
---------

[](#community)

We have an IRC channel where you can find us every now and then. We're on the Freenode network in the channel #polderknowledge.

Credits
-------

[](#credits)

- [Polder Knowledge](https://polderknowledge.com)
- [All Contributors](../../contributors)

License
-------

[](#license)

Please see [LICENSE.md](LICENSE.md) for the license of this application.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71.4% 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 ~0 days

Total

2

Last Release

3233d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0ee7f711ef4d45ada0ac92c7ab2f548055a7cfbe718da6c4bbb81b2f6693c528?d=identicon)[waltertamboer](/maintainers/waltertamboer)

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

---

Top Contributors

[![waltertamboer](https://avatars.githubusercontent.com/u/508054?v=4)](https://github.com/waltertamboer "waltertamboer (5 commits)")[![Erikvv](https://avatars.githubusercontent.com/u/1748197?v=4)](https://github.com/Erikvv "Erikvv (1 commits)")[![mkooij](https://avatars.githubusercontent.com/u/4548220?v=4)](https://github.com/mkooij "mkooij (1 commits)")

---

Tags

flocklockpeekphpflocklockpeekpolderknowledgephp-peek-lock

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/polderknowledge-php-peek-lock/health.svg)

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

###  Alternatives

[symfony/lock

Creates and manages locks, a mechanism to provide exclusive access to a shared resource

514127.6M459](/packages/symfony-lock)[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)
