定制 boldgrid/tdcron 二次开发

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

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

boldgrid/tdcron

最新稳定版本:1.0.0

Composer 安装命令:

composer require boldgrid/tdcron

包简介

A simple utility to manipulate cron jobs.

README 文档

README

WARNING: This class was written back in 2010 ! Its pretty much untested with all PHP versions > 5.6.0 and might act funny. I mostly pushed it to GitHub for easier access and in case if somebody is looking for a simple cron-parser.

tdCron

tdCron is a very simple class to parse cron-expressions and calculate schedules.

For something more sophisticated (and WAY more modern) you can take a look at the cron-expression package by Michael Dowling and Chris Tankersley.

Getting Started

Installation

Just include class.tdcron.php and class.tdcron.entry.php in your project and you're done.

Documentation

As i mentioned before - this class is really, really simple :-)

Please just look at the code in test.php and class.tdcron.php - its reasonably well documented and should be pretty easy to understand.

It basically comes down to calling tdCron::getNextOccurrence() or tdCron::getLastOccurrence() with your cron-expression as the first parameter and an optional reference-time as the second parameter.

Lets say you've got a cron-expression like 5 0 * 8 2 (so something at 00:05 on every tuesday in august). You could use something like

echo 'next: '.date('d.m.Y, H:i:s', tdCron::getNextOccurrence('5 0 * 8 2');

to see when it should run the next time.

Running the tests

There aren't any "real" tests included with the class (so you won't find any PHPUnit-stuff here). You can find a bunch of edge-cases in the test.php / test.data.php files that were used to test the class during development.

License

This project is licensed under the MIT License - see the LICENSE file for details

统计信息

  • 总下载量: 14
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 4
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2022-11-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固