.
*/
define("ROOTPATH", "../");
require_once(ROOTPATH . "include/include.php");
require_once(ROOTPATH . "scripts/ICron.php");
$layout = new Layout();
$layout->init(false);
$layout->pageHeader();
$layout->echoln("
Cron
");
$dir = dirname($_SERVER["SCRIPT_FILENAME"])."/cron/*.php";
if( is_dir(dirname($dir)) ) {
foreach( glob($dir) as $file ) {
if( is_file($file) ) {
require_once($file);
$class = substr(basename($file, ".php"), 3);
$startTime = microtime(true);
$cron = new $class($GLOBALS['sql']);
$layout->echoln("".$cron->getName()."
");
$jobOutput = $cron->run();
$layout->echoln(nl2br($jobOutput));
$layout->echoln("-- Execution took " . number_format((microtime(true) - $startTime) * 1000, 0, ",", ".") . " ms --\n");
}
}
}else {
$layout->error("No cron directory found.");
}
$layout->pageFooter();
?>