定制 ajbdev/cronlingo 二次开发

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

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

ajbdev/cronlingo

Composer 安装命令:

composer require ajbdev/cronlingo

包简介

Express crontabs as human readable phrases

README 文档

README

Build Status

CRON Lingo

CronLingo turns human readable strings about time and turns them into valid crontabs.

Examples:

echo CronLingo::fromExpression('Every day at midnight');
// "0 0 * * *"

echo CronLingo::fromExpression('Every 15 minutes at midnight on the weekend');
// "*/15 0 * * 0,6"

echo CronLingo::fromExpression('Every other minute in August at noon on a weekday');
// "*/2 12 * 8 1,2,3,4,5"

echo CronLingo::fromExpression('The 1st day in April at midnight');
// "0 0 1 4 *"

echo CronLingo::fromExpression('Every day on the weekday at 2:25pm');
// "25 14 * * 1,2,3,4,5"

Syntax

CronLingo identifies the parts of a string with specific time-related keywords such as "on, to, at" and uses this to deduce the time meaning and convert it into part of a cron tab. It's not particular about the order of these statements. Here's a brief list of things that it will pick up and parse into a crontab:

  • Periods (daily, weekly, monthly)
  • Exact times (9:30 PM, 8a, 3p)
  • Meridiems (AM/PM/A/P)
  • Intervals (1st, second, other, ninth, etc)
  • Specific fields (second, minute, hour, day, month)
  • Day of week (sunday, monday, etc)
  • 12 o'clocks (noon, midnight)
  • Lists (e.g., 5 to 12 minutes)
  • Month names (january, february, etc)
  • Weekend / weekday

What's a cron tab?

A cron tab is an expression that defines a recurring period of time.

It looks something like this:

*    *    *    *    *
-    -    -    -    -
|    |    |    |    |
|    |    |    |    +----- day of week (0 - 7) (Sunday=0 or 7)
|    |    |    +---------- month (1 - 12)
|    |    +--------------- day of month (1 - 31)
|    +-------------------- hour (0 - 23)
+------------------------- min (0 - 59)

From Wikipedia:

The software utility Cron is a time-based job scheduler in Unix-like computer operating systems. People who set up and maintain software environments use cron to schedule jobs (commands or shell scripts) to run periodically at fixed times, dates, or intervals. It typically automates system maintenance or administration—though its general-purpose nature makes it useful for things like connecting to the Internet and downloading email at regular intervals.

统计信息

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

GitHub 信息

  • Stars: 146
  • Watchers: 7
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-12-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固