lorisleiva/cron-translator
Composer 安装命令:
composer require lorisleiva/cron-translator
包简介
Makes CRON expressions human-readable
关键字:
README 文档
README
⏰️ Makes CRON expressions human-readable
Installation
composer require lorisleiva/cron-translator
Usage
use Lorisleiva\CronTranslator\CronTranslator; CronTranslator::translate('* * * * *'); // => Every minute CronTranslator::translate('30 22 * * *'); // => Every day at 10:30pm CronTranslator::translate('0 16 * * 1'); // => Every Monday at 4:00pm CronTranslator::translate('0 0 1 1 *'); // => Every year on January the 1st at 12:00am CronTranslator::translate('0 0 1 * *'); // => The 1st of every month at 12:00am CronTranslator::translate('0 * * * 1'); // => Once an hour on Mondays CronTranslator::translate('* 1-20 * * *'); // => Every minute 20 hours a day CronTranslator::translate('0,30 * * * *'); // => Twice an hour CronTranslator::translate('0 1-5 * * *'); // => 5 times a day CronTranslator::translate('0 1 1-5 * *'); // => 5 days a month at 1:00am CronTranslator::translate('*/2 * * * *'); // => Every 2 minutes CronTranslator::translate('* 1/3 2 * *'); // => Every minute of every 3 hours on the 2nd of every month CronTranslator::translate('1-3/5 * * * *'); // => 3 times every 5 minutes CronTranslator::translate('1,2 0 */2 1,2 *'); // => Twice an hour every 2 days 2 months a year at 12am
You may also provide a locale as a second argument and whether to format the time using the 24-hour format as a third argument.
CronTranslator::translate('30 18 * * *', 'fr'); // => Chaque jour à 6:30pm CronTranslator::translate('30 18 * * *', 'fr', true); // => Chaque jour à 18:30
The following locales are currently supported. Feel free to PR more locales if you need them. 🙂
ar— Arabiccs— Czechda— Danishde— Germanen— Englishes— Spanishfr— Frenchhi— Hindilv— Latviannl— Dutchpl— Polishpt— Portuguesero— Romanianru— Russiansk— Slovakua— Ukrainianvi— Vietnamesezh— Simplified Chinesezh-TW— Traditional Chinese
lorisleiva/cron-translator 适用场景与选型建议
lorisleiva/cron-translator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9.54M 次下载、GitHub Stars 达 314, 最近一次更新时间为 2019 年 07 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「cron」 「human」 「expression」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 lorisleiva/cron-translator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 lorisleiva/cron-translator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 lorisleiva/cron-translator 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Symfony bundle to monitor and execute commands
Business rules engine tools.
Scheduling extension for Yii2 framework
Monitoring for scheduled jobs
This package provide a PDF module for yawik.
Condition Builder for logical expressions
统计信息
- 总下载量: 9.54M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 316
- 点击次数: 33
- 依赖项目数: 29
- 推荐数: 7
其他信息
- 授权协议: MIT
- 更新时间: 2019-07-06
