Log in

View Full Version : Proper usage of log_cron_action()


Antivirus
08-15-2007, 08:59 PM
When using function log_cron_action(), the $nextitem parameter... What's it for? Does it tell the php engine to exit the cron script and exec the next cron script in order?

If so, how would you go about logging different cron actions within the same script? Can you exec the function without $nextitem and then on the last call to the function only, include the $nextitem var?

I'm confused, never wrote cron scripts before.
Thanks :)

Paul M
08-15-2007, 09:13 PM
Looking at the function definition ;)

// description = action that was performed
// $nextitem is an array containing the information for this cronjob
// $phrased is set to true if this action is phrased

function log_cron_action($description, $nextitem, $phrased = 0)

Only two array elements are used in the function,' loglevel' and 'varname'.

Antivirus
08-15-2007, 09:52 PM
ah yes, i see now. loglevel is whether or not to log the task in the log, (1 = yes / 0 = no) and varname is self explainatory. It's a bit misleading for jelsoft to have named it $nextitem, as it's name implies that it somehow calls to or points to the next item in line for scheduled tasks, etc... no biggie, got it now, thank you.