helthe/chronos 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

helthe/chronos

最新稳定版本:1.0.0

Composer 安装命令:

composer require helthe/chronos

包简介

Chronos: An object oriented cron job library

README 文档

README

Chronos provides an object oriented library for managing cron jobs both with crontab and programmatically.

Installation

Add the following in your componser.json:

{
    "require": {
        "helthe/chronos": "~1.0"
    }
}

Usage

CRON expression

At its core, Chronos uses a CRON expression parser to validate all cron jobs. It supports all the language characteristics defined here as well as the predefined scheduling definitions except @reboot.

Crontab

You can use the library to both deploy cron jobs directly into crontab.

use Helthe\Component\Chronos\Crontab;
use Helthe\Component\Chronos\Job\CommandJob;

$crontab = new Crontab();
$job = new CommandJob('@hourly', '/usr/bin/my_great_command');

$crontab->add($job);

$crontab->update();

CronJobScheduler

You can also programmatically run cron jobs.

use Helthe\Component\Chronos\CronJobScheduler;
use Helthe\Component\Chronos\Job\CommandJob;

$scheduler = new CronJobScheduler();
$job = new CommandJob('@hourly', '/usr/bin/my_great_command');

$scheduler->add($job);

$scheduler->runJobs();

Credits

Chronos was created to fill the need for managing recurring jobs in PHP. The initial inspiration for it was to have a Whenever equivalent in PHP.

The CRON expression parser was initially based on the parser built by Michael Dowling.

Resources

You can run the unit tests with the following command:

$ cd path/to/Helthe/Component/XXX/
$ composer.phar install --dev
$ phpunit

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-06-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固