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

Get the Cron Expression from database #84

Closed JarbyDev closed 9 years ago

JarbyDev commented 9 years ago

// Works with predefined scheduling definitions $cron = Cron\CronExpression::factory('* * * * *'); $cron->isDue(); echo $cron->getNextRunDate()->format('Y-m-d H:i:s'); echo $cron->getPreviousRunDate()->format('Y-m-d H:i:s');

fruitl00p commented 9 years ago

@thomas1216 you already asked something like this: #80

mtdowling commented 9 years ago

Yes, it is possible. Simply query the database, retrieve the cron expression, and provide it to the factory method as a string.

JarbyDev commented 9 years ago

Its Possible use the Cron Expression work with Dynamic SQL? I need to Create Schedules on the fly, without modifying the Php File. or its a better solution. thanks