panlatent / cron-expression-descriptor
将cron表达式转换为人类可读的描述。
1.1.0
2021-12-06 20:30 UTC
Requires
- php: ^7.1|^8.0
- ext-ctype: *
- ext-intl: *
- myclabs/php-enum: ~1.5
Requires (Dev)
- php-coveralls/php-coveralls: ^2.1
- phpunit/phpunit: ^7.5|^8.0
Suggests
- ext-intl: Help translate cron express description
README
在PHP中将cron表达式转换为人类可读的描述。
该库是 bradymholt/cron-expression-descriptor (C#) 的PHP版本。
安装
建议使用 Composer 安装此项目。
$ composer require panlatent/cron-expression-descriptor
这将安装库及其所有依赖项。该项目需要 PHP 7.1 或更高版本。
用法
echo (new Panlatent\CronExpressionDescriptor\ExpressionDescriptor('23 12 * JAN *'))->getDescription(); // OUTPUT: At 12:23 PM, only in January
端口
此库已被移植到多种其他语言。
- C# - https://github.com/bradymholt/cron-expression-descriptor
- JavaScript - https://github.com/bradymholt/cRonstrue
- Java - https://github.com/RedHogs/cron-parser
- Java - https://github.com/voidburn/cron-expression-descriptor
- Ruby - https://github.com/alpinweis/cronex
- Python - https://github.com/Salamek/cron-descriptor
- Go - https://github.com/lnquy/cron
许可
Cron Expression Descriptor 是开源软件,许可协议为 MIT 许可证。