定制 poliander/cron 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

poliander/cron

Composer 安装命令:

composer require poliander/cron

包简介

Standard (V7) compliant crontab expression parser/validator with support for time zones

README 文档

README

Build Status Code Coverage License Latest Stable Version Total Downloads

Standard (V7) compliant crontab expression parser/validator with support for time zones; see "man 5 crontab" for possible expressions.

Installation

Using composer, add a requirement for poliander/cron to your composer.json file:

composer require poliander/cron

Examples

Validate a certain crontab expression:

use Poliander\Cron\CronExpression;

$expression = new CronExpression('15,45 */2 * * *');
$isValid = $expression->isValid(); // returns true

Check whether a given point in time is matching a certain cron expression:

use Poliander\Cron\CronExpression;

$expression = new CronExpression('45 9 * * *');
$dt = new \DateTime('2014-05-18 09:45');
$isMatching = $expression->isMatching($dt); // returns true

Match an expression across different time zones:

use Poliander\Cron\CronExpression;

$expression = new CronExpression('45 9 * * *', new DateTimeZone('Europe/Berlin'));
$dt = new \DateTime('2014-05-18 08:45', new DateTimeZone('Europe/London'));
$isMatching = $expression->isMatching($dt); // returns true

Calculate next timestamp matching a Friday, the 13th:

use Poliander\Cron\CronExpression;

$expression = new CronExpression('* * 13 * fri');
$when = $expression->getNext();

Supported PHP Versions

cron PHP Note
1.2.* 5.6 end of life
2.0.* 7.0 end of life
2.1.* 7.1 end of life
2.2.* 7.2 end of life
2.3.* 7.3 end of life
2.4.* 7.4 - 8.2 end of life
3.0.* 7.4 - 8.2 end of life
3.1.* 8.1 - 8.3 end of life
3.2.* 8.2 - 8.4
3.3.* 8.3 - 8.5

Changelog

version release notes
1.0.0 (2015-06-20) initial release
1.1.0 (2016-06-11) dropped PHP 5.4 support
1.2.0 (2016-12-11) added PHP 7.1 support
1.2.1 (2017-05-25) fixed #3
1.2.2 (2017-06-03) fixed #3, #4
2.0.0 (2017-11-30) dropped PHP 5.x, added PHP 7.2 support, added vendor namespace (closes #2)
2.1.0 (2018-12-08) dropped PHP 7.0, added PHP 7.3 support, updated PHPUnit dependency to 7.*
2.2.0 (2019-12-03) dropped PHP 7.1, added PHP 7.4 support, updated PHPUnit dependency to 8.*
2.3.0 (2020-12-29) dropped PHP 7.2, added PHP 8.0 support, updated PHPUnit dependency to 9.*
2.3.1 (2021-10-04) fixed #6
2.4.0 (2021-12-27) dropped PHP 7.3, added PHP 8.1 support
2.4.1 (2022-03-25) fixed #9
2.4.2 (2022-04-09) fixed #9, #10, #11
2.4.3 (2022-04-10) fixed #12
2.4.4 (2022-04-11) fixed #13
2.4.5 (2022-12-17) fixed #14
2.4.6 (2022-12-29) added PHP 8.2 support
2.4.7 (2023-01-20) fixed #16
2.4.8 (2023-07-30) fixed #18, #19
2.4.9 (2023-10-28) fixed #22
3.0.0 (2022-04-09) namespace changed to avoid package conflict (closes #8)
3.0.1 (2022-04-10) fixed #12
3.0.2 (2022-04-11) fixed #13
3.0.3 (2022-12-17) fixed #14
3.0.4 (2022-12-29) added PHP 8.2 support
3.0.5 (2023-01-20) fixed #16
3.0.6 (2023-07-30) fixed #18, #19
3.0.7 (2023-10-28) fixed #22
3.1.0 (2023-11-23) added PHP 8.3 support, dropped PHP 7/8.0 support, updated PHPUnit to 10.*
3.2.0 (2024-11-22) added PHP 8.4 support, dropped PHP 8.1 support, updated PHPUnit to 11.*
3.2.1 (2024-12-21) fixed #26
3.2.2 (2026-03-05) fixed #30
3.3.0 (2025-11-23) added PHP 8.5 support, dropped PHP 8.2 support
3.3.1 (2026-03-05) fixed #30

poliander/cron 适用场景与选型建议

poliander/cron 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 396.04k 次下载、GitHub Stars 达 79, 最近一次更新时间为 2015 年 03 月 17 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 poliander/cron 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 poliander/cron 我们能提供哪些服务?
定制开发 / 二次开发

基于 poliander/cron 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 396.04k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 80
  • 点击次数: 30
  • 依赖项目数: 8
  • 推荐数: 0

GitHub 信息

  • Stars: 79
  • Watchers: 3
  • Forks: 10
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2015-03-17