swekaj / cron-expression-generator
Generate valid cron expressions.
Installs: 66 354
Dependents: 1
Suggesters: 0
Security: 0
Stars: 10
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=5.3.0
- fzaninotto/faker: ~1.4
This package is not auto-updated.
Last update: 2024-12-21 17:01:56 UTC
README
Generate valid, random cron expressions.
Installation
Add the CronExpressionGenerator library to your composer.json
file:
composer require swekaj/cron-expression-generator
Usage
To use this with Faker, you must add the CronExpressionGenerator\FakerProvider
class to the Faker generator:
<?php $faker = \Faker\Factory::create(); $faker->addProvider(new \CronExpressionGenerator\FakerProvider($faker)); // Generator sample output $faker->cron(); // 12-38 */4 * * 2000/5 $faker->cronMinute(); // */12,30-39 $faker->cronHour(); // 0-23 $faker->cronDayOfMonth(); // L,14W,30 $faker->cronMonth(); // 1/2,6-8 $faker->cronDayOfWeek(); // 0-2,4W,3#2 $faker->cronYear(); // 2012,2000-2039