addToQueue($jobs_to_run, $crontasks); $lastrun_update['tasks'] = $crontasks; } elseif (substr(strtolower($argv[$x]), 0, 2) == '--') { if (strlen($argv[$x]) > 3) { $cronfile = makeCorrectFile(FROXLOR_INSTALL_DIR . '/scripts/jobs/cron_' . substr(strtolower($argv[$x]), 2) . '.php'); addToQueue($jobs_to_run, $cronfile); $lastrun_update[substr(strtolower($argv[$x]), 2)] = $cronfile; } } } } // do we have anything to include? if (count($jobs_to_run) > 0) { // include all jobs we want to execute foreach ($jobs_to_run as $cron) { updateLastRunOfCron($lastrun_update, $cron); require_once $cron; } } fwrite($debugHandler, 'Cronfiles have been included' . "\n"); /** * we have to check the system's last guid with every cron run * in case the admin installed new software which added a new user * so users in the database don't conflict with system users */ $cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'Checking system\'s last guid'); checkLastGuid(); // shutdown cron include_once FROXLOR_INSTALL_DIR . '/lib/cron_shutdown.php'; // -- helper function function addToQueue(&$jobs_to_run, $cronfile = null, $checkExists = true)
} elseif (strtolower($argv[$x]) == '--debug') { define('CRON_DEBUG_FLAG', 1); } elseif (substr(strtolower($argv[$x]), 0, 2) == '--') { if (strlen($argv[$x]) > 3) { $cronname = substr(strtolower($argv[$x]), 2); addToQueue($jobs_to_run, $cronname); } } } } $cronlog->setCronDebugFlag(defined('CRON_DEBUG_FLAG')); // do we have anything to include? if (count($jobs_to_run) > 0) { // include all jobs we want to execute foreach ($jobs_to_run as $cron) { updateLastRunOfCron($cron); $cronfile = getCronFile($cron); require_once $cronfile; } } fwrite($debugHandler, 'Cronfiles have been included' . "\n"); /** * we have to check the system's last guid with every cron run * in case the admin installed new software which added a new user * so users in the database don't conflict with system users */ $cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'Checking system\'s last guid'); checkLastGuid(); // shutdown cron include_once FROXLOR_INSTALL_DIR . '/lib/cron_shutdown.php'; // -- helper function