News Feed
Jobs Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Michael Dowling's Blog:
Cron Expression Parsing in PHP
June 04, 2012 @ 12:03:52

Michael Dowling has shared a new tool on his blog today - a parser for crontab files that can be used directly from within PHP - cron-expression.

When faced with the task of creating the cron expression parsing part of this system, I searched high and low for an existing implementation in PHP that implemented the full feature set of a modern cron expression. Based on the context of this article, you probably guessed that I didn't find one. I posted the original code I came up with to StackOverflow and eventually open sourced the project.

Not only does the tool let you read from the cron files but it also lets you do other fun things like:

  • Determine the next run date for the program
  • Calculate the next X number of run dates/times
  • Find the last run date of the program
  • Check to see if an expression will run on a certain date

The full source for the tool is available for download (and pull requests!) over on github.

0 comments voice your opinion now!
cron parse tool cronexpression example


blog comments powered by Disqus

Similar Posts

OpenSky Blog: Inheritance in PHP, or why you want to use an Interface or an Abstract class...

Bit-Tech.net Formus: PHP "raycaster" 3D renderer

Mike Bernat's Blog: Installing Xdebug - Best Decision You Will Ever Make

Alexey Zakhlestin's Blog: PHP+SCGI part 2: problem with eZComponents

PseudoCoder.com: How To Really Use Xdebug To Speed Up Your App


Community Events











Don't see your event here?
Let us know!


release code opinion install language component hack framework example package overview hhvm security introduction composer unittest podcast application facebook symfony2

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework