// iterate throuhg files/directories. $realpath = $basedir . DIRECTORY_SEPARATOR . $filename; // If it's a directory (except for "." & "..") if (is_file($realpath) && substr($filename, 0, 1) !== '.') { // possible script. include $realpath; } } } /** Schedule tasks for all frequencies */ // DDBB handler. $db = new \creamy\DbHandler(); // Module handler $mh = \creamy\ModuleHandler::getInstance(); // 1. Run the system scheduled jobs. $scheduleMinFreq = $db->getSettingValueForKey(CRM_SETTING_JOB_SCHEDULING_MIN_FREQ); if (empty($scheduleMinFreq)) { $scheduleMinFreq = CRM_JOB_SCHEDULING_HOURLY; } // 1.a Hourly tasks if ($scheduleMinFreq <= CRM_JOB_SCHEDULING_HOURLY) { scheduleJobsInDirectory(CRM_JOB_SCHEDULER_HOURLY_DIR); // invoke the job scheduling in modules. $mh->scheduleJobsOnActiveModules(CRM_JOB_SCHEDULING_HOURLY); } // 1.b Daily tasks if ($scheduleMinFreq <= CRM_JOB_SCHEDULING_DAILY) { $lastDailySchedule = $db->getSettingValueForKey(CRM_SETTING_JOB_LAST_DAY); $scheduleNow = false; if (empty($lastDailySchedule)) { $scheduleNow = true;
/** * Returns the base creamy URL for this creamy installation, including any root directory (if applicable). * I.E: returns http://www.yoursite.com/your_crm_path/ (if Creamy is installed there). * This setting must be changed if the server changes. */ public static function creamyBaseURL() { $db = new \creamy\DbHandler(); return $db->getSettingValueForKey(CRM_SETTING_CRM_BASE_URL); }