Download the PHP package adhocore/cron-expr without Composer
On this page you can find all versions of the php package adhocore/cron-expr. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download adhocore/cron-expr
More information about adhocore/cron-expr
Files in adhocore/cron-expr
Package cron-expr
Short Description Ultra lightweight Cron Expression parser for PHP
License MIT
Informations about the package cron-expr
adhocore/cron-expr
- Lightweight Cron expression parser library for PHP.
- Zero dependency.
- Very fast because it bails early in case a segment doesnt match.
- Real benchmark shows it is about 7.54x to 12.92x faster than
dragonmantank/cron-expression
Installation
Usage
Basic
Bulk checks
When checking for several jobs at once, if more than one of the jobs share equivalent expression then the evaluation is done only once per go thus greatly improving performnce.
Cron Expression
Cron expression normally consists of 5 segments viz:
and sometimes there can be 6th segment for <year>
at the end.
Real Abbreviations
You can use real abbreviations for month and week days. eg: JAN
, dec
, fri
, SUN
Tags
Following tags are available and they are converted to real cron expressions before parsing:
- @yearly or @annually - every year
- @monthly - every month
- @daily - every day
- @weekly - every week
- @hourly - every hour
- @5minutes - every 5 minutes
- @10minutes - every 10 minutes
- @15minutes - every 15 minutes
- @30minutes - every 30 minutes
- @always - every minute
You can refer them with constants from
Ahc\Cron\Normalizer
likeAhc\Cron\Normalizer::WEEKLY
Modifiers
Following modifiers supported
- Day of Month / 3rd segment:
L
stands for last day of month (eg:L
could mean 29th for February in leap year)W
stands for closest week day (eg:10W
is closest week days (MON-FRI) to 10th date)
- Day of Week / 5th segment:
L
stands for last weekday of month (eg:2L
is last monday)#
stands for nth day of week in the month (eg:1#2
is second sunday)
LICENSE
© MIT | 2017-2019, Jitendra Adhikari
Credits
This project is release managed by please.