bastiendonjon / pid-file-manager
PID file manager for prevent overlapping in cron task
Installs: 2 222
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: >=5.4.0
This package is not auto-updated.
Last update: 2024-12-07 21:06:25 UTC
README
PID Manager for prevent overlapping in cron task
Requirements
- PHP >= 5.4.0
Composer installation
You must modify your composer.json
file and run composer update
to include the latest version of the package in your project:
"require": { "bastiendonjon/pid-file-manager": "1.0.*" }
Or you can run the composer require
command from your terminal:
composer require bastiendonjon/pid-file-manager
Usage
// Usage in simple task : $elem = new PIDFileManager('myProcessName', storage_path()); $elem->start(); // Usage in daemon task : $elem = new PIDFileManager('myProcessName', storage_path()); $elem->start(); // Add oneTime if you demonize your script while(true) { sleep(1) $elem->oneTime(); }