pe / component-cron
Crontab manipulation library
Installs: 11
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/pe/component-cron
Requires
- php: >=5.5
- symfony/process: ~2.8|~3.0
Requires (Dev)
- phpunit/phpunit: ~5.0
This package is auto-updated.
Last update: 2025-10-05 21:58:05 UTC
README
Installation
php composer.phar require pe/component-cron:^1.0
Usage
use PE\Component\Cron\Crontab; use PE\Component\Cron\Job; // Instantiate with default binary path $crontab = new Crontab(); // Or instantiate with custom binary path $crontab = new Crontab('/usr/sbin/crontab'); // Get all jobs $crontab->all();// returns array of Job instances // Create new job from string $job = Job::fromString('*/5 * * * * command'); // Or create programmatically $job = (new Job())->setMinute('*/5')->setCommand('command'); // Add job $crontab->add($job); // Get job by index $job = $crontab->get(0); // Remove job by index $crontab->remove(0);