PHP Cron Expression Parser
==========================
[![Latest Stable Version](https://poser.pugx.org/mtdowling/cron-expression/v/stable.png)](https://packagist.org/packages/mtdowling/cron-expression) [![Total Downloads](https://poser.pugx.org/mtdowling/cron-expression/downloads.png)](https://packagist.org/packages/mtdowling/cron-expression) [![Build Status](https://secure.travis-ci.org/mtdowling/cron-expression.png)](http://travis-ci.org/mtdowling/cron-expression)
The PHP cron expression parser can parse a CRON expression, determine if it is
due to run, calculate the next run date of the expression, and calculate the previous
run date of the expression. You can calculate dates far into the future or past by
skipping n number of matching dates.
The parser can handle increments of ranges (e.g. */12, 2-59/3), intervals (e.g. 0-9),
lists (e.g. 1,2,3), W to find the nearest weekday for a given day of the month, L to
find the last day of the month, L to find the last given weekday of a month, and hash
(#) to find the nth weekday of a given month.
Credits
==========
Created by Micheal Dowling. Ported to PHP 5.2 by Flightless, Inc.
Based on version 1.0.3: https://github.com/mtdowling/cron-expression/tree/v1.0.3
Installing
==========
Add the following to your project's composer.json:
```javascript
{
"require": {
"mtdowling/cron-expression": "1.0.*"
}
}
```
Usage
=====
```php
<?php
require_once '/vendor/autoload.php';
// Works with predefined scheduling definitions
$cron = Cron\CronExpression::factory('@daily');
$cron->isDue();
echo $cron->getNextRunDate()->format('Y-m-d H:i:s');
echo $cron->getPreviousRunDate()->format('Y-m-d H:i:s');
// Works with complex expressions
$cron = Cron\CronExpression::factory('3-59/15 2,6-12 */15 1 2-5');
echo $cron->getNextRunDate()->format('Y-m-d H:i:s');
// Calculate a run date two iterations into the future
$cron = Cron\CronExpression::factory('@daily');
echo $cron->getNextRunDate(null, 2)->format('Y-m-d H:i:s');
// Calculate a run date relative to a specific time
$cron = Cron\CronExpression::factory('@monthly');
echo $cron->getNextRunDate('2010-01-12 00:00:00')->format('Y-m-d H:i:s');
```
CRON Expressions
================
A CRON expression is a string representing the schedule for a particular command to execute. The parts of a CRON schedule are as follows:
* * * * * *
- - - - - -
| | | | | |
| | | | | + year [optional]
| | | | +----- day of week (0 - 7) (Sunday=0 or 7)
| | | +---------- month (1 - 12)
| | +--------------- day of month (1 - 31)
| +-------------------- hour (0 - 23)
+------------------------- min (0 - 59)
Requirements
============
- PHP 5.3+
- PHPUnit is required to run the unit tests
- Composer is required to run the unit tests
CHANGELOG
=========
1.0.3 (2013-11-23)
------------------
* Only set default timezone if the given $currentTime is not a DateTime instance (#34)
* Fixes issue #28 where PHP increments of ranges were failing due to PHP casting hyphens to 0
* Now supports expressions with any number of extra spaces, tabs, or newlines
* Using static instead of self in `CronExpression::factory`
没有合适的资源?快使用搜索试试~ 我知道了~
【WordPress插件】2022年最新版完整功能demo+插件v4.38.0.zip
共213个文件
php:168个
svg:13个
css:10个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 80 浏览量
2022-03-28
21:55:39
上传
评论
收藏 669KB ZIP 举报
温馨提示
"【WordPress插件】2022年最新版完整功能demo+插件v4.38.0 WooCommerce Smart Coupons Woocommerce智能优惠券" ---------- 泰森云每天更新发布最新WordPress主题、HTML主题、WordPress插件、shopify主题、opencart主题、PHP项目源码、安卓项目源码、ios项目源码,更有超10000个资源可供选择,如有需要请站内联系。
资源推荐
资源详情
资源评论
收起资源包目录
【WordPress插件】2022年最新版完整功能demo+插件v4.38.0.zip (213个子文件)
cbl-admin.css 13KB
cbl-admin.min.css 12KB
smart-coupon-designs.css 9KB
smart-coupon.css 8KB
smart-coupon.min.css 7KB
jquery-ui-timepicker-addon.css 2KB
jquery-ui-timepicker-addon.min.css 2KB
smart-coupons-admin.css 942B
wc-sc-style-email-coupon.css 660B
wc-sc-style-email-coupon.min.css 594B
sample.csv 2KB
jquery-ui-timepicker-addon.js 80KB
chosen.jquery.js 43KB
jquery-ui-timepicker-addon.min.js 40KB
chosen.jquery.min.js 26KB
sc-gutenberg-block.js 3KB
sc-shortcode.js 1KB
LICENSE 1KB
README.md 3KB
README.md 3KB
woocommerce-smart-coupons-fr_FR.mo 104KB
class-wc-smart-coupons.php 187KB
class-wc-sc-display-coupons.php 83KB
class-wc-sc-admin-pages.php 61KB
class-wc-sc-coupon-process.php 57KB
class-wc-sc-settings.php 49KB
class-wc-sc-purchase-credit.php 47KB
class-wc-sc-coupon-fields.php 46KB
class-wcs-sc-compatibility.php 45KB
class-wc-sc-background-coupon-importer.php 44KB
ActionScheduler_wpPostStore.php 34KB
class-wc-sc-coupon-import.php 33KB
class-wc-sc-coupons-by-product-quantity.php 32KB
class-wc-sc-shortcode.php 31KB
class-wc-sc-coupons-by-taxonomy.php 30KB
ActionScheduler_DBStore.php 27KB
class-wc-sc-coupon-actions.php 26KB
class-wc-sc-admin-welcome.php 25KB
class-wc-sc-coupons-by-location.php 25KB
class-wc-sc-privacy.php 24KB
class-wc-sc-coupons-by-product-attribute.php 24KB
ActionScheduler_Abstract_ListTable.php 24KB
class-wc-sc-apply-before-tax.php 22KB
ActionScheduler_ListTable.php 20KB
class-wc-sc-auto-apply-coupon.php 20KB
class-wc-sc-admin-notifications.php 18KB
class-wc-sc-product-fields.php 18KB
class-wc-sc-email-coupon.php 18KB
class-wc-sc-coupons-by-user-role.php 17KB
class-wc-sc-url-coupon.php 16KB
class-wc-sc-order-fields.php 15KB
class-wc-sc-print-coupon.php 15KB
class-wc-sc-coupons-by-shipping-method.php 14KB
class-wc-sc-coupon-message.php 13KB
class-wc-sc-ajax.php 13KB
ActionScheduler_Store.php 12KB
class-wc-sc-coupons-by-payment-method.php 12KB
class-wc-sc-coupon-parser.php 12KB
class-wc-sc-background-upgrade.php 12KB
ActionScheduler_HybridStore.php 12KB
class-wc-sc-admin-coupons-dashboard-actions.php 12KB
functions.php 12KB
CronExpression.php 11KB
class-wc-sc-acknowledgement-email.php 11KB
class-wc-sc-global-coupons.php 9KB
ActionScheduler.php 9KB
ActionScheduler_Abstract_QueueRunner.php 8KB
class-wc-sc-act-deact.php 8KB
combined-email.php 8KB
class-wc-sc-combined-email-coupon.php 8KB
ActionScheduler_ActionFactory.php 8KB
email.php 8KB
class-wc-sc-rest-coupons-controller.php 7KB
ActionScheduler_QueueRunner.php 7KB
class-wc-sc-coupon-categories.php 7KB
ActionScheduler_wpCommentLogger.php 7KB
print-coupons-default.php 6KB
ActionScheduler_WPCLI_QueueRunner.php 6KB
Controller.php 6KB
ActionScheduler_Logger.php 6KB
ActionScheduler_AdminView_Deprecated.php 5KB
ActionScheduler_AdminView.php 5KB
combined-email.php 5KB
ActionScheduler_wcSystemStatus.php 5KB
ActionScheduler_DataController.php 5KB
ActionScheduler_QueueCleaner.php 5KB
ActionScheduler_WPCLI_Scheduler_command.php 5KB
functions.php 5KB
email.php 5KB
class-wc-sc-coupon-columns.php 5KB
Migration_Command.php 5KB
ActionScheduler_Abstract_Schema.php 5KB
ActionScheduler_StoreSchema.php 5KB
class-wcopc-sc-compatibility.php 4KB
ActionScheduler_DBLogger.php 4KB
ActionScheduler_TimezoneHelper.php 4KB
ActionScheduler_WPCommentCleaner.php 4KB
class-wc-sc-email.php 4KB
class-wc-sc-gutenberg-coupon-block.php 4KB
promotion.php 4KB
共 213 条
- 1
- 2
- 3
资源评论
Lee达森
- 粉丝: 969
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 使用ASP.NET Core和Entity Framework Core来构建一个基本的进销存系统.rar
- 深度学习经典数据集+FER2013面部表情识别+附带使用方法的python代码
- Python中,要实现连接多个相机并识别多个二维码.rar
- 使用FFT算法对一个信号进行分析.rar
- 171cms游戏应用下载系统源码.zip
- 基于jsp+servlet+mysql蛋糕甜品店购物网站源码+数据库(期末大作业).zip
- Java项目:在线蛋糕商城系统(java+jsp+mysql)源码+数据库+期末大作业.zip
- ZapyaClient10_7-1.apk
- 织梦cms站长导航网站源码.zip
- 基于SSM+MySQL的网络投票调查问卷系统源码+数据库(java期末大作业).zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功