$php = $version[0] * 10000 + $version[1] * 100 + $version[2]; if ($php < 50300) { $hostName = php_uname('n'); } else { $hostName = gethostname(); } $mailbody = "Instance dir : {$root_directory} <br/> Company Name : {$organization_name} <br/> Site Url : {$site_URL} <br/> Host Name : {$hostName}<br/>"; $mailSubject = "[Alert] {$organization_name} "; if (PHP_SAPI === "cli" || isset($_SESSION["authenticated_user_id"]) && isset($_SESSION["app_unique_key"]) && $_SESSION["app_unique_key"] == $application_unique_key) { $cronTasks = false; if (isset($_REQUEST['service'])) { // Run specific service $cronTasks = array(Vtiger_Cron::getInstance($_REQUEST['service'])); } else { // Run all service $cronTasks = Vtiger_Cron::listAllActiveInstances(); } $cronRunId = microtime(true); $cronStarts = date('Y-m-d H:i:s'); //set global current user permissions global $current_user; $current_user = Users::getActiveAdminUser(); echo sprintf('[CRON],"%s",%s,Instance,"%s","",[STARTS]', $cronRunId, $site_URL, $cronStarts) . "\n"; foreach ($cronTasks as $cronTask) { try { $cronTask->setBulkMode(true); // Not ready to run yet? if (!$cronTask->isRunnable()) { echo sprintf("[INFO] %s - not ready to run as the time to run again is not completed\n", $cronTask->getName()); continue; }