cron.php 350 Bytes
Newer Older
1
<?php
2

3
include_once "includes/common.inc";
4

Dries's avatar
Dries committed
5
function cron_run() {
6 7
  $time = time();
  $result = db_query("SELECT * FROM crons WHERE $time - timestamp > scheduled");
8
  while ($task = db_fetch_object($result)) module_invoke($task->module, "cron");
9 10
  db_query("UPDATE crons SET timestamp = $time WHERE $time - timestamp > scheduled");
}
11

12
cron_run();
13

14
?>