Download the PHP package nephifey/cron-expression without Composer

On this page you can find all versions of the php package nephifey/cron-expression. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package cron-expression

cron-expression

Cron expression parser to get the previous run date, next run date, and determine if the expression is due to run based on the next run date. This implementation supports the minute, hour, day of the month, month, and day of the week attributes and only supports a limited amount of non-standard characters/macros, see the Cron Expression Format below.

Cron Expression Format:

Refer to the Cron Wikipedia Page if desired, which is where most this content is from, but keep in mind this library doesn't support everything documented within there.

Supported Characters:

Character Description Example Expression
Asterisk * Equivalent to "all" or the entire allowed range of values. * * * * *
Comma , Comma separated value list for scheduling multiple different times. 3,57 * * * SUN,MON
Hyphen - Used to specify a range of values for scheduling multiple different times. * * * * TUE-SAT
Slash / Used to specify stepped values throughout the allowed range of values. */5 * * * *
Numeric (or) Non-standard Literal Schedule using a specific number within the allowed range of values. 5 * * * *

Supported Non-standard Literals:

Attribute Literal Mapped Numeric
month JAN 1
month FEB 2
month MAR 3
month APR 4
month MAY 5
month JUN 6
month JUL 7
month AUG 8
month SEP 9
month OCT 10
month NOV 11
month DEC 12
day of the week SUN 0
day of the week MON 1
day of the week TUE 2
day of the week WED 3
day of the week THU 4
day of the week FRI 5
day of the week SAT 6
day of the week 7 0

Supported Non-standard Macros:

Macro Description Mapped Expression
@yearly Run once a year at midnight of 1 January 0 0 1 1 *
@annually Run once a year at midnight of 1 January 0 0 1 1 *
@monthly Run once a month at midnight of the first day of the month 0 0 1 1 *
@weekly Run once a week at midnight on Sunday 0 0 1 1 *
@daily Run once a day at midnight 0 0 1 1 *
@midnight Run once a day at midnight 0 0 1 1 *
@hourly Run once an hour at the beginning of the hour 0 0 1 1 *

Getting Started

Install the package into your project using composer via the command below.

Usage

Basic Example

Parse cron expressions and get the previous run date, next run date, or check if the expression is due.

Scheduler Example

Use as a crontab alternative to keep expressions within the codebase or database.

Crontab Setup:

Codebase Setup:

Additional Examples

You can pass a custom datetime to the isDue method instead of the current datetime/timezone. Additionally, you can enable strict mode, so then it must match the exact datetime/timezone.

You can reparse cron expressions directly on the expression object based on a new datetime/timezone later on. This can be done in a mutable or immutable way depending on your need.


All versions of cron-expression with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package nephifey/cron-expression contains the following files

Loading the files please wait ....