dev-master
9999999-devManage your crontab with some simple PHP commands.
MIT
The Requires
- php >=7.0.0
- ext-spl *
- sebastianfeldmann/cli ~1.0
by Sebastian Feldmann
crontab
Wallogit.com
2017 © Pedro Peláez
Manage your crontab with some simple PHP commands.
Lists all cron jobs with a nice OO interface. Add jobs to your crontab., (*2)
Installing crontab via Composer., (*3)
"require": {
"sebastianfeldmann/crontab": "~1.0"
}
$crontab = new SebastianFeldmann\Crontab\Operator();
foreach ($crontab->getJobs() as $job) {
echo "Description: . PHP_EOL . implode(PHP_EOL, $job->getComments()) . PHP_EOL;
echo "Schedule: " . PHP_EOL . $job->getSchedule() . PHP_EOL;
echo "Command: " . PHP_EOL . $job->getCommand() . PHP_EOL;
}
$crontab = new SebastianFeldmann\Crontab\Operator();
$crontab->addJob(
new SebastianFeldmann\Crontab\Job(
'30 4 * * *',
'/foo/bar/binary',
['Some foo bar binary execution']
)
);
This will add the following lines to your crontab., (*4)
# Some foobar binary execution 30 4 * * * /foo/bar/binary
The crontab parser is looking for commands and their description in the lines above the command. The parser expects commands to NOT spread over multiple lines with \., (*5)
# Descriptoon for some command 10 23 * * * some command # Next Command Description # even more description for the next command 30 5 * * * next command
Manage your crontab with some simple PHP commands.
MIT
crontab