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

Sameer Borate:
Cron Expression Parser in PHP
Jul 21, 2015 @ 15:15:09

If you've ever worked with the "cron" tool on a unix-based system, you know that there's a special syntax that comes along with defining when the commands should run. It can be difficult to get this timing exactly right, especially if you're very picky about the execution time. In this post from Sameer Borate he shows you a PHP library that can help not only parse current cron configurations but also provides shortcuts for common timings (ex: "daily" or "weekly").

Working with cron scheduling can many times be a frustrating affair. Although setting a few cron jobs at one time can be easy, calculating cron dates in the future in code can get time consuming quickly. The PHP cron expression parser described here can parse a CRON expression, determine if it is due to run, calculate the next run date of the expression or calculate the previous run date of the expression. You can calculate dates far into the future or past by skipping n number of matching dates.

He includes some examples of putting the library to use to define a cron object based on an expression (either via a shortcut or an actual cron time expression). You can then check to see if the cron is "due" or perform some various operations about its run dates. This includes a formatted output of the previous run time, the next run time and the calculation of the next/previous run time based on a relative timestamp.

tagged: cron parser library example tutorial run due evaluation datetime

Link: http://www.codediesel.com/php/cron-expression-parser-in-php/

Lukas Smith's Blog:
emPHPower
Mar 27, 2008 @ 16:19:13

In a moment of divine inspiration (well, at least a thought that passed through his head at the bus stop), Lukas Smith has thought up and is proposing a group to help promote and advocate PHP, one he calls emPHPower.

emPHPower should be a mediator between various (potential) participants in the PHP world. As such emPHPower could serve as a mediator between the PHP.net developers and its user base, between corporations and PHP.net, between corporations and grass roots organizers etc. [...] There are is fundamental concept that I see in this vision: emPHPower is a mediator and catalyst that empowers members of the community to follow their own ideas.

He talks more about the actual "doing" of his ideas and mentions things like the project's budget and where it would come from - the possibility of member fees (based somehow on cost of living).

tagged: emphpower advocacy group member due fee budget community

Link:


Trending Topics: