本文整理汇总了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;
}