}
## Failsafe
if (!class_exists("OutputHandler")) {
    class OutputHandler
    {
        public static function displayOutput($output)
        {
            $o = $output;
            $colors = array("%lightgray%" => "", "%darkgrey%" => "", "%blue%" => "", "%lightblue%" => "", "%green%" => "", "%lightgreen%" => "", "%cyan%" => "", "%lightcyan%" => "", "%red%" => "", "%lightred%" => "", "%purple%" => "", "%lightpurple%" => "", "%brown%" => "", "%yellow%" => "", "%lightgray%" => "", "%white%" => "");
            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);