PHPackages                             sunaoka/process-guard-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. sunaoka/process-guard-php

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

sunaoka/process-guard-php
=========================

This library has been designed with the intention of preventing the execution of multiple instances of a script.

v1.0.1(1y ago)114MITPHPPHP ^8.0CI passing

Since May 24Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/sunaoka/process-guard-php)[ Packagist](https://packagist.org/packages/sunaoka/process-guard-php)[ RSS](/packages/sunaoka-process-guard-php/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelogDependencies (4)Versions (4)Used By (0)

ProcessGuard for PHP
====================

[](#processguard-for-php)

[![Latest](https://camo.githubusercontent.com/4f6ab9383d4294397379eab475fde77fc3df3d5dd6ea63e21123e21ebd5b4609/68747470733a2f2f706f7365722e707567782e6f72672f73756e616f6b612f70726f636573732d67756172642d7068702f76)](https://packagist.org/packages/sunaoka/process-guard-php)[![License](https://camo.githubusercontent.com/850913bb1cc00c4c0eb3fc8b4b726792a55416625eca730b214b31a868c8c256/68747470733a2f2f706f7365722e707567782e6f72672f73756e616f6b612f70726f636573732d67756172642d7068702f6c6963656e7365)](https://packagist.org/packages/sunaoka/process-guard-php)[![PHP](https://camo.githubusercontent.com/4083e6106d2768df5c3165b80b8cde724ebd375fc142ec5367c6001503b3c4b8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f73756e616f6b612f70726f636573732d67756172642d706870)](composer.json)[![Test](https://github.com/sunaoka/process-guard-php/actions/workflows/test.yml/badge.svg)](https://github.com/sunaoka/process-guard-php/actions/workflows/test.yml)[![codecov](https://camo.githubusercontent.com/5453d72e1caaa2d1395e4331efe3a719b1c6eb8af648beee9468baddfd63e129/68747470733a2f2f636f6465636f762e696f2f67682f73756e616f6b612f70726f636573732d67756172642d7068702f6272616e63682f646576656c6f702f67726170682f62616467652e737667)](https://codecov.io/gh/sunaoka/process-guard-php)

---

This library has been designed with the intention of preventing the execution of multiple instances of a script.

In the event that it is intended for use in batch processing and a script is already running, all subsequent attempts at execution can be terminated until the current process completes.

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

[](#installation)

```
composer require sunaoka/process-guard-php
```

Basic Usage
-----------

[](#basic-usage)

```
use Sunaoka\ProcessGuard\Drivers\FileDriver;
use Sunaoka\ProcessGuard\LockFactory;

$driver = new FileDriver();
$factory = new LockFactory($driver);

$lock = $factory->create('Preventing Multiple Instances', ttl: 60.0);
if ($lock->acquire() === false) {
    // already running
    exit;
}

// You can do some processing

$lock->release();
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance59

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

Total

2

Last Release

521d ago

### Community

Maintainers

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

---

Top Contributors

[![sunaoka](https://avatars.githubusercontent.com/u/105845?v=4)](https://github.com/sunaoka "sunaoka (22 commits)")

---

Tags

phpprevent-multiple-instancesprocess-guardphpprocessmultiplelockguardinstancesprevent

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/sunaoka-process-guard-php/health.svg)

```
[![Health](https://phpackages.com/badges/sunaoka-process-guard-php/health.svg)](https://phpackages.com/packages/sunaoka-process-guard-php)
```

###  Alternatives

[php-lrpm/php-lrpm

PHP Long Running Process Manager

187.8k1](/packages/php-lrpm-php-lrpm)

PHPackages © 2026

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