[geeklog-cvs] geeklog-1.3/public_html lib-common.php,1.418,1.419

blaine at iowaoutdoors.org blaine at iowaoutdoors.org
Fri Mar 25 22:03:08 EST 2005


Update of /var/cvs/geeklog-1.3/public_html
In directory www:/tmp/cvs-serv17046/public_html

Modified Files:
	lib-common.php 
Log Message:
Added new API to allow plugins to run sheduled tasks or code. An internal GL cron process that won't be time sensitive as it's dependant on someone accessing the site to activate the code but should serve most requirements. Added new setting to set the interval between runs -  $_CONF['cron_schedule_interval'].

Code will also check if there is a CUSTOM_runSheduledJob function as some blocks or non-plugins may have code to run as well.

Added new record to the vars table to hold that last UNIX_TIMESTAMP of when the Internal Cron check was last run.


Index: lib-common.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/public_html/lib-common.php,v
retrieving revision 1.418
retrieving revision 1.419
diff -C2 -d -r1.418 -r1.419
*** lib-common.php	23 Feb 2005 18:48:17 -0000	1.418
--- lib-common.php	26 Mar 2005 03:03:05 -0000	1.419
***************
*** 5543,5545 ****
--- 5543,5555 ----
  }
  
+ /* Check and see if any plugins (or custom function) have scheduled tasks to perform */
+ if ( (DB_getItem($_TABLES['vars'], 'value', "name='last_scheduled_run'") 
+         + $_CONF['cron_schedule_interval'] ) <= time() ) {
+     if (function_exists(CUSTOM_runSheduledJob)) {
+         CUSTOM_runSheduledJob();
+     }
+     PLG_runScheduledJob();
+     DB_query("UPDATE {$_TABLES['vars']} SET value=UNIX_TIMESTAMP() WHERE name='last_scheduled_run'");
+ }
+ 
  ?>




More information about the geeklog-cvs mailing list