function _runner() { _runnerLog('Running Cron'); $pageTimer = new \Jackbooted\Time\Stopwatch('Run time for ' . basename(__FILE__)); _runnerLog('Checking if scheduled jobs need to be added to CronQueue'); Scheduler::check(); $numberOfItemsProcessed = 0; while ($pageTimer->getTime() < 60) { $cronJobList = Cron::getList(1); if (count($cronJobList) <= 0) { break; } foreach ($cronJobList as $cronJob) { _runnerLog('Found Job: ' . $cronJob->id); flush(); _runnerLog('Changing the status to RUNNING for JobID: ' . $cronJob->id); $cronJob->status = CronDAO::STATUS_RUNNING; $cronJob->runTime = time(); $cronJob->save(); flush(); $cronJob->result = -1; $cronJob->message = ''; _runnerLog('Running command: ' . $cronJob->command . ' ID:' . $cronJob->id); unset($result); @eval('$result = ' . $cronJob->command); if (isset($result) && is_array($result)) { $cronJob->result = $result[0]; $cronJob->message = $result[1]; } _runnerLog('Finished Job ID: ' . $cronJob->id . ' Result: ' . $cronJob->result . ' Message: ' . $cronJob->message); $cronJob->status = CronDAO::STATUS_COMPLETE; $cronJob->save(); flush(); $numberOfItemsProcessed++; } } _runnerLog('Processed ' . $numberOfItemsProcessed . ' items.'); _runnerLog($pageTimer->logLoadTime()); }
<?php use Jackbooted\Admin\Admin; use Jackbooted\Admin\Login; use Jackbooted\Config\Cfg; use Jackbooted\DB\DBManager; use Jackbooted\Admin\SuperAdmin; require_once dirname(__FILE__) . '/config.php'; Cfg::set('accesslevel', 0); $pageTimer = new \Jackbooted\Time\Stopwatch('Page Load'); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <html> <head> <meta name="description" content="Super Administration" /> <meta name="keywords" content="Super Administration" /> <title>Super Administration</title> <link rel="shortcut icon" href="<?php echo Cfg::get('favicon'); ?> " type="image/x-icon"> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" > <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css"> </head> <body> <table width="100%" cellpadding="5" cellspacing="0" class="table table-bordered"> <tr> <td width="100%"> <table width="100%" cellpadding="0" cellspacing="0"> <tr> <td width="100" nowrap="nowrap" valign="top" height="50">