Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
This package has been abandoned. Use dragonmantank/cron-expression instead.
Generated on May 18, 2024 via composer

mtdowling/cron-expression v1.2.3

CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due
Package summary
Share
1
issue
1
high severity
meta
1
1
license
1
MIT
Package created
18 Jan 2012
Version published
28 Dec 2019
Maintainers
1
Total deps
1
Direct deps
0
License
MIT

Issues

1

1 high severity issue

high
via: mtdowling/cron-expression@v1.2.3
Collapse
Expand

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
mtdowling/cron-expression@v1.2.3
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of mtdowling/cron-expression 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does mtdowling/cron-expression do?

The "mtdowling/cron-expression" package is a PHP cron expression parser. It brings the ability to understand CRON scheduling definitions, making it possible to determine when a CRON expression is due to run, calculate the next or previous run dates, and even skip N number of matching dates. It supports a wide array of expressions including increments of ranges, intervals, list, and special characters like "W", "L" and "#", used for specific weekday and monthday calculations.

How do you use mtdowling/cron-expression?

To use the "mtdowling/cron-expression" in your PHP project, you'll require to install it via composer by adding 'mtdowling/cron-expression' to your dependencies. Once installed, you can instantiate it by calling 'CronExpression::factory()' with your desired CRON expression as an argument. A few examples below illustrate its usage:

<?php

require_once '/vendor/autoload.php';

// Regular daily scheduling
$cron = Cron\CronExpression::factory('@daily');
// Check if the cron is due
$cron->isDue();
// Display the next run date
echo $cron->getNextRunDate()->format('Y-m-d H:i:s');
// Display the previous run date
echo $cron->getPreviousRunDate()->format('Y-m-d H:i:s');

// More complex cron expression
$cron = Cron\CronExpression::factory('3-59/15 2,6-12 */15 1 2-5');
echo $cron->getNextRunDate()->format('Y-m-d H:i:s');

// Get the run date two iterations into the future
$cron = Cron\CronExpression::factory('@daily');
echo $cron->getNextRunDate(null, 2)->format('Y-m-d H:i:s');

// Get the 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');

Where are the mtdowling/cron-expression docs?

The documentation for the "mtdowling/cron-expression" package can be found on its GitHub page at "https://github.com/mtdowling/cron-expression". The readme file in the main repository is a comprehensive source of information, providing all the necessary details on usage, CRON expression structure, requirements, and installation instructions.