jdecool / crontab-parser
解析crontab
1.0.0
2024-01-14 13:52 UTC
Requires
- php: ^8.1
- dragonmantank/cron-expression: ^3.1
Requires (Dev)
- ergebnis/composer-normalize: ^2.41
- friendsofphp/php-cs-fixer: ^3.46
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^10.5
README
这是一个用PHP编写的简单的crontab解析器。
安装
使用 Composer 安装
$ composer require jdecool/crontab-parser
入门指南
<?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