summaryrefslogtreecommitdiffstats
path: root/cron.php
diff options
context:
space:
mode:
authorDries Buytaert2000-12-23 15:13:34 +0000
committerDries Buytaert2000-12-23 15:13:34 +0000
commit0cadc4e68340e02e6b51c29a672db7bb92386fa7 (patch)
treeb90c382a12576719babed8b68af35eab11f01d6c /cron.php
parent5976e2f85e8d9d67e2d26d46fce0f867f130aa62 (diff)
- intermediate commit: some bugfixes, changes and some drastic
changes to block and module support
Diffstat (limited to 'cron.php')
-rw-r--r--cron.php21
1 files changed, 19 insertions, 2 deletions
diff --git a/cron.php b/cron.php
index 3767923..3cb6abf 100644
--- a/cron.php
+++ b/cron.php
@@ -1,7 +1,24 @@
<?
-include "includes/cron.inc";
+include "includes/theme.inc";
+
+function cron_run($cron) {
+ global $repository;
+
+ $time = time();
+
+ $result = db_query("SELECT * FROM crons WHERE $time - timestamp > scheduled");
+
+ while ($task = db_fetch_object($result)) {
+ if ($repository[$task->module]["cron"]) {
+ watchdog("message", "cron: executed '". $task->module ."_cron()'");
+ $repository[$task->module]["cron"]();
+ }
+ }
+
+ db_query("UPDATE crons SET timestamp = $time WHERE $time - timestamp > scheduled");
+}
cron_run();
-?>
+?> \ No newline at end of file