alanpich / daemon
Lightweight wrapper for starting & stopping background processes
Installs: 22
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/alanpich/daemon
This package is not auto-updated.
Last update: 2025-10-07 06:23:58 UTC
README
====================
Spawns background processes via PHP. Can also stop them again
Installation
{ "require": { "alanpich/php-daemon": "*" } }
Usage
// Command to execute $script = 'php '.dirname(__FILE__).'/index.php'; // File to log to $logFile = dirname(__FILE__).'/log.txt'; // Path to save pid file to $pidFile = dirname(__FILE__).'/process.pid'; // Create the daemon wrapper $daemon = new \AlanPich\Daemon\DaemonProcess($script,$pidFile,$logFile); $daemon->start(); echo $daemon->status()? 'RUNNING' : 'NOT RUNNING'; $daemon->stop();