} ## Failsafe if (!class_exists("OutputHandler")) { class OutputHandler { public static function displayOutput($output) { $o = $output; $colors = array("%lightgray%" => "[0;30m", "%darkgrey%" => "[1;30m", "%blue%" => "[0;34m", "%lightblue%" => "[1;34m", "%green%" => "[0;32m", "%lightgreen%" => "[1;32m", "%cyan%" => "[0;36m", "%lightcyan%" => "[1;36m", "%red%" => "[0;31m", "%lightred%" => "[1;31m", "%purple%" => "[0;35m", "%lightpurple%" => "[1;35m", "%brown%" => "[0;33m", "%yellow%" => "[1;33m", "%lightgray%" => "[0;37m", "%white%" => "[1;37m"); foreach ($colors as $key => $value) { $o = str_replace($key, $value, $o); } echo $o; } } } ## Get the correct DB config and connection /*if(GenConfig::LIVE) : $dbh = new DBTasks(DBConfig::DBL_SERVER, DBConfig::DBL_USER, DBConfig::DBL_PASS, DBConfig::DBL_PORT, DBConfig::DBL_DBASE); else : $dbh = new DBTasks(DBConfig::DBD_SERVER, DBConfig::DBD_USER, DBConfig::DBD_PASS, DBConfig::DBD_PORT, DBConfig::DBD_DBASE); endif;*/ if (class_exists("CronManagerDB")) { $dbh = new DBTasks(CronManagerDB::DSN, CronManagerDB::USER, CronManagerDB::PASS, CronManagerDB::DBPORT, CronManagerDB::DBDATABASE); ## Start the application CronManager::DoRun($dbh); SR_Agent::Log(GenConfig::API, SystemReporter::MSG_SUCCESS, "System run completed :)"); } else { OutputHandler::displayOutput("%lightred%FATAL ERROR: Could not load CronManagerDB, quitting...&lightgrey%\n\n"); } exit(0);