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(7y ago)3701[1 issues](https://github.com/stavarengo/php-signal-handler/issues)MITPHPPHP &gt;=5.0

Since Nov 27Pushed 7y 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 2mo 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 37% 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

2878d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/02880a6c5616df078a79e18a49c23d9135ddd1278454b894914faa33d23e0232?d=identicon)[Stavarengo](/maintainers/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

[ecotone/ecotone

Supporting you in building DDD, CQRS, Event Sourcing applications with ease.

558549.8k17](/packages/ecotone-ecotone)[civicrm/civicrm-core

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

728272.9k20](/packages/civicrm-civicrm-core)[j0k3r/php-readability

Automatic article extraction from HTML

186808.8k6](/packages/j0k3r-php-readability)[symfony/ai-platform

PHP library for interacting with AI platform provider.

51927.7k136](/packages/symfony-ai-platform)[symfony/ai-agent

PHP library for building agentic applications.

30536.7k44](/packages/symfony-ai-agent)[spomky-labs/pwa-bundle

Progressive Web App Manifest Generator Bundle for Symfony.

6144.4k1](/packages/spomky-labs-pwa-bundle)

PHPackages © 2026

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