Download the PHP package sivaschenko/utility-cron without Composer

On this page you can find all versions of the php package sivaschenko/utility-cron. 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 utility-cron

PHP Cron Library

Codacy Badge Build Status StyleCI codecov

The PHP Cron Library can be used to get human readable cron expression description and detailed validation messages. Any level of expression complexity is handled.

Code examples

Human readable cron expression description example:

$expression = \Sivaschenko\Utility\Cron\ExpressionFactory::getExpression('5 4 8 * *');

echo $expression->getVerbalString(); // "At 04:05, on 8th day of month."

Cron expression validation example:

$expression = \Sivaschenko\Utility\Cron\ExpressionFactory::getExpression('60 * * * 2- *');

if (!$expression->isValid()) {
    print_r($expression->getValidationMessages());
}

/*
Array
(
    [0] => Minute expression part value "60" is greater than max allowed "59"
    [1] => Missing second part of "range" expression ("2-")
)
*/

Functionality examples

Examples of expression translation to verbal format:

Cron Expression Description
* At every minute.
@weekly On Monday at midnight
5 4 8 At 04:05, on 8th day of month.
FRIL * At every minute, on last Friday of the month.
* 2/2 mon/3 At every minute, every 2nd month starting from February, every 3rd day of week starting from Monday.
30/5 2-6 ? jan,feb 2#4 2017 Every 5th minute starting from 30th, every hour from 2nd through 6th, in January and February, every 4th Tuesday, in 2017

Examples of cron expression validation:

Invalid Cron Expression Validation Messages
fd * Minute expression part value "fd" is not valid! Allowed values are integers from 0 to 59, keywords: "*", "?"
60 2# Minute expression part value "60" is greater than max allowed "59", Missing second part of "each" expression ("2#")
mon/tue * Second part of expression "mon/tue" can only be integer!
4L * Day of month expression part value "4L" is not valid! Allowed values are integers from 1 to 31, keywords: "*", "?", "W", "L" Allowed suffixes: "W"
@invalid Unknown shortcut expression "@invalid"! List of valid shortcut expressions: "@reboot", "@midnight", "@daily", "@yearly", "@annually", "@monthly", "@weekly", "@hourly".

Installation

Add dependency on library to composer.json and update or execute the following command:

composer require sivaschenko/utility-cron

Be sure to require composer generated autoload in your project:

require 'vendor/autoload.php';

Now see "Code examples" for usage instructions.

Test Coverage

Verbal translation, validation and even exceptions are covered with integration tests.

See \Sivaschenko\Utility\Cron\Test\ExpressionTest for details.


Crafted with ♥ for developers.


All versions of utility-cron with dependencies

PHP Build Version
Package Version
No informations.
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 sivaschenko/utility-cron contains the following files

Loading the files please wait ....