PHPackages                             aalfiann/event-locker-php - 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. aalfiann/event-locker-php

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

aalfiann/event-locker-php
=========================

Event Locker class to stop multiple or parallel execution in PHP.

1.0.0(7y ago)0361MITPHPPHP &gt;=5.4

Since Apr 20Pushed 7y ago1 watchersCompare

[ Source](https://github.com/aalfiann/event-locker-php)[ Packagist](https://packagist.org/packages/aalfiann/event-locker-php)[ RSS](/packages/aalfiann-event-locker-php/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (2)Used By (1)

Event Locker
============

[](#event-locker)

[![Version](https://camo.githubusercontent.com/7d631bce3086afaabfab9cc431d0da66d433ffbd6d4f2bdd0224b6991ee77598/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f737461626c652d312e302e302d677265656e2e737667)](https://github.com/aalfiann/event-locker-php)[![Total Downloads](https://camo.githubusercontent.com/09781df8bd40537e714be87c794bb1f9d84decc2357b5126c337fd58158607ec/68747470733a2f2f706f7365722e707567782e6f72672f61616c6669616e6e2f6576656e742d6c6f636b65722d7068702f646f776e6c6f616473)](https://packagist.org/packages/aalfiann/event-locker-php)[![License](https://camo.githubusercontent.com/2018c45e014bca89a531b28cb80e09eed0aa2eb94fe5f02b3e9c35eb74b5da74/68747470733a2f2f706f7365722e707567782e6f72672f61616c6669616e6e2f6576656e742d6c6f636b65722d7068702f6c6963656e7365)](https://github.com/aalfiann/event-locker-php/blob/HEAD/LICENSE.md)

A Event Locker class to stop multiple or parallel execution in PHP.

Installation
------------

[](#installation)

Install this package via [Composer](https://getcomposer.org/).

```
composer require "aalfiann/event-locker-php:^1.0"

```

How to use
----------

[](#how-to-use)

```
use aalfiann\EventLocker;
require_once ('vendor/autoload.php');

$locker = new EventLocker();

// lock
echo "Waiting...\n";
$locker->lock();

// sleep for 10 seconds
echo "Sleeping...\n";
sleep(10);
echo "Finished!\n";

// unlock
$locker->unlock();
```

You can set your custom locker name. Default is `locker.lock`.

```
// Example if you want to set identify locker for post.
$locker = new EventLocker('post.lock');
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

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

2577d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

eventparallelpsr4locker

### Embed Badge

![Health badge](/badges/aalfiann-event-locker-php/health.svg)

```
[![Health](https://phpackages.com/badges/aalfiann-event-locker-php/health.svg)](https://phpackages.com/packages/aalfiann-event-locker-php)
```

###  Alternatives

[doctrine/event-manager

The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.

6.1k501.1M115](/packages/doctrine-event-manager)[league/event

Event package

1.6k141.6M184](/packages/league-event)[laminas/laminas-eventmanager

Trigger and listen to events within a PHP application

1.0k69.8M225](/packages/laminas-laminas-eventmanager)[winzou/state-machine

A very lightweight yet powerful PHP state machine

52113.7M18](/packages/winzou-state-machine)[spatie/laravel-event-sourcing

The easiest way to get started with event sourcing in Laravel

9003.7M26](/packages/spatie-laravel-event-sourcing)[spatie/laravel-google-calendar

Manage events on a Google Calendar

1.4k1.5M21](/packages/spatie-laravel-google-calendar)

PHPackages © 2026

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