PHPackages                             firegate666/daemon - 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. [CLI &amp; Console](/categories/cli)
4. /
5. firegate666/daemon

ActiveLibrary[CLI &amp; Console](/categories/cli)

firegate666/daemon
==================

Simple PHP daemon wrapper for your custom handler, integrates easily with initd or supervisor

0.1.2(10y ago)223Apache-2.0PHPPHP &gt;=5.4.0

Since Oct 9Pushed 10y ago3 watchersCompare

[ Source](https://github.com/firegate666/SimpleDaemon)[ Packagist](https://packagist.org/packages/firegate666/daemon)[ Docs](https://github.com/firegate666/SimpleDaemon)[ RSS](/packages/firegate666-daemon/feed)WikiDiscussions master Synced yesterday

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

Simple daemon
=============

[](#simple-daemon)

What is this project about
--------------------------

[](#what-is-this-project-about)

You have background tasks for your project? You want to code them in PHP? You need a simple framework to attach your tasks to?

Please try out my wrapper for your daemon tasks.

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

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

That is quite simple, have a look at the example daemon to get an idea what you need to implement.

Integrate it via composer into project

```
composer require firegate666/daemon

```

Create your own daemon handler and daemon handler factory be implementing `HandlerInterface` and `HandlerInterfaceFactory`. Setup your own startup php script, see `exampled.php`

### setup with start-stop-daemon

[](#setup-with-start-stop-daemon)

Copy your own init script to `/etc/init.d/`, see `etc/init.d/exampled.daemon.sh`.

### setup with supervisor

[](#setup-with-supervisor)

Download and install [Supervisord](http://supervisord.org/). On Ubuntu or similar it is quite easy to use `apt-get install`. Copy your supervisor configuration to `/etc/supervisor/conf.d/`, see `etc/supervisor/conf.d/exampled.conf`. Copy your own init script to `/etc/init.d/`, see `etc/init.d/exampled.supervisor.sh`.

### control it

[](#control-it)

Now you can control your daemon

```
/etc/init.d/exampled start
/etc/init.d/exampled stop
/etc/init.d/exampled restart
/etc/init.d/exampled status

```

How does this thing work
------------------------

[](#how-does-this-thing-work)

Via a command line sript you can start up the daemon, see `exampled.php`. Write your own handler and factory and inject them into the daemon. When the daemon starts up, he forks 4 child processes with your pre-defined handler. If one child goes down, a new one is started. Each child process has its own handler instance and starts the run loop.

If the daemon itself receives a shutdown signal (SIGTERM, SIGINT), this signal is dispatched to his children and the daemon waits for their termination before he goes down himself.

ToDos
-----

[](#todos)

- too many children died in short amount of time detection
- proper log messages and levels
- define guidelines for levels

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity50

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

Total

3

Last Release

3921d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2696fa691b52b3f52b657bc27c49a3324828796155638a7f3603cd9557f9a186?d=identicon)[firegate666](/maintainers/firegate666)

---

Top Contributors

[![firegate666](https://avatars.githubusercontent.com/u/1197926?v=4)](https://github.com/firegate666 "firegate666 (31 commits)")

### Embed Badge

![Health badge](/badges/firegate666-daemon/health.svg)

```
[![Health](https://phpackages.com/badges/firegate666-daemon/health.svg)](https://phpackages.com/packages/firegate666-daemon)
```

###  Alternatives

[symfony/http-kernel

Provides a structured process for converting a Request into a Response

8.1k869.4M8.8k](/packages/symfony-http-kernel)[symfony/cache

Provides extended PSR-6, PSR-16 (and tags) implementations

4.2k373.5M3.3k](/packages/symfony-cache)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[league/climate

PHP's best friend for the terminal. CLImate allows you to easily output colored text, special formats, and more.

1.9k14.7M300](/packages/league-climate)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[ecotone/ecotone

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

564576.7k53](/packages/ecotone-ecotone)

PHPackages © 2026

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