fixed the directory making bits for the downloader...
[glcas.git] / plugins / cron.php
diff --git a/plugins/cron.php b/plugins/cron.php
new file mode 100644 (file)
index 0000000..8168e9a
--- /dev/null
@@ -0,0 +1,37 @@
+<?php
+global $URL_HANDLERS;
+$URL_HANDLERS["cron"] = "GLCASCron";
+
+class GLCASCron {
+       function __construct($config)
+       {
+               $this->config = $config;
+               error_log("constructor for GLCASCron");
+               
+       }
+       
+       function go($url)
+       {
+               global $CRON_CLASSES;
+               
+               echo "<html>";
+               foreach($CRON_CLASSES as $crons) {
+                       $calling = new $crons($this->config);
+                       if(method_exists($crons, "cron")) {
+                               echo "<font color=\"green\">CRON: Calling $crons"."->cron:</font><br>";
+                               echo "<table><tr><td><font color=\"green\">$crons</font></td><td>";
+                               $calling->cron();
+                               echo "</td></tr></table>";
+                       } else {
+                               echo "<font color=\"red\">CRON: would call $crons"."->cron but it doesnt exist</font><br>";
+                       }
+                       
+               }
+               echo "</html>";
+       }
+       
+       private $config;
+}
+
+
+?>
\ No newline at end of file