PHPackages                             stavarengo/php-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. stavarengo/php-signal-handler

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

stavarengo/php-signal-handler
=============================

A new and taste way to handle signal from your operational system into you PHP scripts.

v0.0.4(8y ago)3701[1 issues](https://github.com/stavarengo/php-signal-handler/issues)MITPHPPHP &gt;=5.0

Since Nov 27Pushed 8y ago1 watchersCompare

[ Source](https://github.com/stavarengo/php-signal-handler)[ Packagist](https://packagist.org/packages/stavarengo/php-signal-handler)[ RSS](/packages/stavarengo-php-signal-handler/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (1)Versions (6)Used By (0)

php-signal-handler
==================

[](#php-signal-handler)

A new and taste way to handle signal from your operational system. If you need to detect when some other process ask your script to stop, this is the library you are looking for.

Internally We use [pcntl-signal](http://php.net/manual/en/function.pcntl-signal.php) PHP function, so, if you wanna to create your own code to detect this signals, read the docs of this function is a good start.

Installing
----------

[](#installing)

Execute `composer require stavarengo/php-signal-handler`

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

[](#how-to-use-it)

We use the observer patner to notify listeners when the signal it wants to listen arrives.

So, first you need to implement the interface `\Sta\PhpSignalHandler\Listener`.

After that, just call `\Sta\PhpSignalHandler\SignalHandler::attach(array(SIGTERM), $listener)`, where:

1. `SIGTERM` is one of the constants about signals that PHP offers to us ([see here](http://php.net/manual/en/function.pcntl-signal.php)).
2. You will only notified about the signals you passed as the first parameter, in the example above, only the signal `SIGTERM`.
3. `$listener` is an instance of a class that implements the interface `\Sta\PhpSignalHandler\Listener`.

Thats all! When your script receive a signal that you are interested, the listener will be notified.

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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

Total

5

Last Release

2971d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/816369?v=4)[Rafael Stavarengo](/maintainers/Stavarengo)[@stavarengo](https://github.com/stavarengo)

---

Top Contributors

[![stavarengo](https://avatars.githubusercontent.com/u/816369?v=4)](https://github.com/stavarengo "stavarengo (7 commits)")

### Embed Badge

![Health badge](/badges/stavarengo-php-signal-handler/health.svg)

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

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k39.6k](/packages/matomo-matomo)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

568591.1k62](/packages/ecotone-ecotone)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

762297.9k52](/packages/civicrm-civicrm-core)[illuminate/broadcasting

The Illuminate Broadcasting package.

7127.4M234](/packages/illuminate-broadcasting)[logiscape/mcp-sdk-php

Model Context Protocol SDK for PHP

367137.2k15](/packages/logiscape-mcp-sdk-php)[typo3/cms-redirects

TYPO3 CMS Redirects - Create manual redirects, list existing redirects and automatically createredirects on slug changes.

167.6M84](/packages/typo3-cms-redirects)

PHPackages © 2026

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