oudirichi / scheduler
A PHP version of Whenever gem.
Installs: 18
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
pkg:composer/oudirichi/scheduler
Requires
- symfony/console: ~2.3|~3.0
This package is not auto-updated.
Last update: 2025-11-05 06:27:31 UTC
README
Installation
Install the latest version for global usage with
$ composer global require oudirichi/scheduler
or per project
$ composer require oudirichi/scheduler
Getting started
$ cd /apps/my-great-project # for global $ shedulerize # for specific project $ vendor/bin/shedulerize
This will create an initial config/schedule.php file for you.
The scheduler command
$ cd /apps/my-great-project
$ scheduler
This will simply show you your schedule.rb file converted to cron syntax. It does not read or write your crontab file; you'll need to do this in order for your jobs to execute:
$ scheduler --update-crontab
Define your own job types
<?php Scheduler\job_type("pewpew", "cd :path && :task"); Scheduler\every("* * * * *", function($cron) { $cron->pewpew('echo "pewpew" >> log/test.log'); });
Cron format
* * * * * *
| | | | | |
| | | | | +-- Year (range: 1900-3000)
| | | | +---- Day of the Week (range: 0-6 OR 1-7, 0 and 7 both stand for Sunday)
| | | +------ Month of the Year (range: 1-12)
| | +-------- Day of the Month (range: 1-31)
| +---------- Hour (range: 0-23)
+------------ Minute (range: 0-59)