mtdowling / cron-expression

CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due
http://mtdowling.com/blog/2012/06/03/cron-expressions-in-php/
MIT License
4.9k stars 335 forks source link

validate cron expression #168

Closed fawzib closed 6 years ago

fawzib commented 6 years ago

need a simple function that validates cron expressions, instead of crashing and going in an endless loop

dragonmantank commented 6 years ago

Hello @fawzib , I'm sorry to hear you are having trouble.

Please note that this version of the library is no longer receiving updates, which is the primary reason I'm closing this issue. Feel free to make a new issue over at https://github.com/dragonmantank/cron-expression, which contains a newer version and is currently supported.

I would suggest first upgrading to the new library, with the most current release being 2.1. The 2.x line has a different set of validation rules, which may correct your issue. If you are using Laravel, this would mean upgrading to at least 5.6, and you will automatically upgrade to the new library. This older version of the library and the newer version cannot be installed at the same time.

When making the issue, please provide a sample expression that you are trying to validate, the version of the library you are using (2.0, 2.1, dev-master), and the exact error or output you are seeing.