PHPackages                             jtrw/posix-signal-handler - 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. jtrw/posix-signal-handler

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

jtrw/posix-signal-handler
=========================

Handler for Posix signals

1.0.0(3y ago)09MITMakefilePHP &gt;=7.4

Since Sep 21Pushed 3y ago1 watchersCompare

[ Source](https://github.com/jtrw/posix-signal-handler)[ Packagist](https://packagist.org/packages/jtrw/posix-signal-handler)[ Docs](https://github.com/jtrw/posix-signal-handler)[ RSS](/packages/jtrw-posix-signal-handler/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

Posix Signal Handler
====================

[](#posix-signal-handler)

[![Phpunit](https://github.com/jtrw/posix-signal-handler/workflows/Phpunit/badge.svg)](https://github.com/jtrw/posix-signal-handler/actions)[![codecov](https://camo.githubusercontent.com/d3ac49bedb95d9699e2d47e63808b9112a02b556af850363313397b9018a189e/68747470733a2f2f636f6465636f762e696f2f67682f6a7472772f706f7369782d7369676e616c2d68616e646c65722f6272616e63682f6d61737465722f67726170682f62616467652e7376673f746f6b656e3d50344254364b38495846)](https://codecov.io/gh/jtrw/posix-signal-handler)[![Latest Stable Version](https://camo.githubusercontent.com/30b06efd86f58084be369c0048ef8ab73e8aebf60f21ac33c90f7e3b0bd5d9fc/687474703a2f2f706f7365722e707567782e6f72672f6a7472772f706f7369782d7369676e616c2d68616e646c65722f76)](https://packagist.org/packages/jtrw/posix-signal-handler)[![Total Downloads](https://camo.githubusercontent.com/2fc52e2e593ac23b75533ffbbbb68534e1b3ccd45aa90cb6993408bfc741277d/687474703a2f2f706f7365722e707567782e6f72672f6a7472772f706f7369782d7369676e616c2d68616e646c65722f646f776e6c6f616473)](https://packagist.org/packages/jtrw/posix-signal-handler)[![Latest Unstable Version](https://camo.githubusercontent.com/42eaa0ff6a7ee851df047c66cfa5487fd69588e093c5c6200fcd962913f611bc/687474703a2f2f706f7365722e707567782e6f72672f6a7472772f706f7369782d7369676e616c2d68616e646c65722f762f756e737461626c65)](https://packagist.org/packages/jtrw/posix-signal-handler)[![License](https://camo.githubusercontent.com/8d3e4c2c1137990e8dbeffa8807c4a539cf6f509be7a837bf1615bed6e058c5e/687474703a2f2f706f7365722e707567782e6f72672f6a7472772f706f7369782d7369676e616c2d68616e646c65722f6c6963656e7365)](https://packagist.org/packages/jtrw/posix-signal-handler)[![PHP Version Require](https://camo.githubusercontent.com/efea95191f8ac785bb3f479a2a166b59dd62da9341d9f9c14f110cc027477965/687474703a2f2f706f7365722e707567782e6f72672f6a7472772f706f7369782d7369676e616c2d68616e646c65722f726571756972652f706870)](https://packagist.org/packages/jtrw/posix-signal-handler)

First of all it is necessary for some scripts that work like php process in the background our system. For example queue or workers that run through cron, and working in operation memory full time like demons. Sometimes you need to terminate some php process like this `kill -9 pid`because you should restart scripts now, and you can have some problem. If you terminate process now, you don't know place where you program break off. Special for this you can use soft kill `kill -SIGTERM pid`In your code yous should integrate this library For Example:

```
declare(ticks = 1);

require_once __DIR__."/../vendor/autoload.php";
$signal = new \Jtrw\PosixSignal\SignalHandler();

while (true) {
    $this->doSomething(); //Your Business logic
    $signal->terminate();
}
```

When our code get signal like `SIGTERM`, `SIGINT`, `SIGTSTP`, `SIGTERM`, `SIGHUP`, `SIGILL`it process your code to logic end, and soft finish your script.

Require
-------

[](#require)

`composer require jtrw/posix-signal-handler`

Tests
-----

[](#tests)

You can run test in docker container. For run docker container you can exec command: `make start` it command run `docker-compose up -d`After it, you can run unittest in docker container for it execute `make tests`

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

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

Unknown

Total

1

Last Release

1326d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cb69a84ba4d32377e911fcda345ebe671a0a98cbd748c4cf0e3cd786ee12af37?d=identicon)[nil-bora](/maintainers/nil-bora)

---

Top Contributors

[![nilBora](https://avatars.githubusercontent.com/u/5442473?v=4)](https://github.com/nilBora "nilBora (43 commits)")

---

Tags

posix

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/jtrw-posix-signal-handler/health.svg)

```
[![Health](https://phpackages.com/badges/jtrw-posix-signal-handler/health.svg)](https://phpackages.com/packages/jtrw-posix-signal-handler)
```

###  Alternatives

[seld/signal-handler

Simple unix signal handler that silently fails where signals are not supported for easy cross-platform development

18271.3M18](/packages/seld-signal-handler)[arara/process

Provides a better API to work with processes on Unix-like systems

16861.7k2](/packages/arara-process)[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)
