Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 18, 2024 via composer

dragonmantank/cron-expression v3.3.3

CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due
Package summary
Share
0
issues
1
license
2
MIT
Package created
12 Oct 2017
Version published
10 Aug 2023
Maintainers
1
Total deps
2
Direct deps
1
License
MIT

Issues

0
This package has no issues

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
2 Packages, Including:
dragonmantank/cron-expression@v3.3.3
webmozart/assert@1.11.0
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

1
All Dependencies CSV
β“˜ This is a list of dragonmantank/cron-expression 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
webmozart/assert1.11.019.58 kBMIT
prod

Visualizations

Frequently Asked Questions

What does dragonmantank/cron-expression do?

Dragonmantank/cron-expression is a powerful tool that gives PHP the ability to handle CRON expressions. This PHP cron expression parser can interpret a CRON expression, determine if it's due for execution, calculate the next and previous run dates of the expression, and even manage complex expressions involving ranges, lists, weekdays, and more. It's great for scheduling tasks and events far into the future or the past.

How do you use dragonmantank/cron-expression?

To use the Dragonmantank/cron-expression package, first add it to your PHP project using composer command composer require dragonmantank/cron-expression. After installing the package, you can utilize it in your PHP code. Here's an example:

<?php

require_once '/vendor/autoload.php';

// For predefined scheduling definitions
$cron = new Cron\CronExpression('@daily');
$cron->isDue();
echo $cron->getNextRunDate()->format('Y-m-d H:i:s');
echo $cron->getPreviousRunDate()->format('Y-m-d H:i:s');

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

// To calculate a run date two iterations ahead
$cron = new Cron\CronExpression('@daily');
echo $cron->getNextRunDate(null, 2)->format('Y-m-d H:i:s');

// To calculate a run date based on a specific time
$cron = new Cron\CronExpression('@monthly');
echo $cron->getNextRunDate('2010-01-12 00:00:00')->format('Y-m-d H:i:s');

Where are the dragonmantank/cron-expression docs?

The main source of documentation for the Dragonmantank/cron-expression package can be found on its GitHub page, and in the readme file of the package. The readme file explains the functions, usage details, installation procedure, and contains examples to assist users. Additionally, the creator's blog post provides further insight into the fork's features and capabilities. Keep in mind the information about the format of cron expressions, and the predefined scheduling definitions (macros), while using this package.