本文整理匯總了PHP中Vtiger_Cron::listAllActiveInstances方法的典型用法代碼示例。如果您正苦於以下問題:PHP Vtiger_Cron::listAllActiveInstances方法的具體用法?PHP Vtiger_Cron::listAllActiveInstances怎麽用?PHP Vtiger_Cron::listAllActiveInstances使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Vtiger_Cron
的用法示例。
在下文中一共展示了Vtiger_Cron::listAllActiveInstances方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: php_uname
$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;
}