vvondra / php-daemon
A base implementation of a UNIX daemon in PHP
Installs: 158
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 1
Open Issues: 1
pkg:composer/vvondra/php-daemon
Requires
- php: >=5.3.0
- ext-posix: *
This package is not auto-updated.
Last update: 2025-10-25 20:46:59 UTC
README
If you're comfortable with PHP and want to have a PHP script running as a daemon (meaning you can leave it running in the background, stop, restart it and check it's status) this class provides a basic implementation of the necessary features.
Running a script as a daemon can be more convenient than a CRON triggered task and you can be sure it will be running in only one process at a time..
Simply subclass it and implement the run() method. You might find the React Event Loop useful if you want an alternative to sleeping.