jdecool/crontab-parser

1.0.0 2024-01-14 13:52 UTC

This package is auto-updated.

Last update: 2024-04-21 13:46:21 UTC


README

A simple crontab parser written in PHP.

Installation

Install it with Composer:

$ composer require jdecool/crontab-parser

Getting started

<?php

$content = <<<CRONTAB
# m h  dom mon dow   command
* * * * *   /usr/bin/php /path/to/script.php
0 0 * * *   /usr/bin/php /path/to/other/script.php
CRONTAB;

$parser = JDecool\CrontabParser\CrontabParser();
$crontab = $parser->parse($content); // return a `JDecool\CrontabParser\Crontab` instance