當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Scalr_Util_DateTime::convertTzFromUTC方法代碼示例

本文整理匯總了PHP中Scalr_Util_DateTime::convertTzFromUTC方法的典型用法代碼示例。如果您正苦於以下問題:PHP Scalr_Util_DateTime::convertTzFromUTC方法的具體用法?PHP Scalr_Util_DateTime::convertTzFromUTC怎麽用?PHP Scalr_Util_DateTime::convertTzFromUTC使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Scalr_Util_DateTime的用法示例。


在下文中一共展示了Scalr_Util_DateTime::convertTzFromUTC方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getServerStatus

 /**
  * @param DBServer $dbServer
  * @param bool $cached check only cached information
  * @param int $timeout
  * @return array|null
  */
 public function getServerStatus(DBServer $dbServer, $cached = true, $timeout = 0)
 {
     if ($dbServer->status == SERVER_STATUS::RUNNING && ($dbServer->IsSupported('0.8') && $dbServer->osType == 'linux' || $dbServer->IsSupported('0.19') && $dbServer->osType == 'windows')) {
         if ($cached && !$dbServer->IsSupported('2.7.7')) {
             return ['status' => 'statusNoCache', 'error' => "<span style='color:gray;'>Scalarizr is checking actual status</span>"];
         }
         try {
             $scalarizr = $dbServer->scalarizrUpdateClient->getStatus($cached);
             try {
                 if ($dbServer->farmRoleId != 0) {
                     $scheduledOn = $dbServer->GetFarmRoleObject()->GetSetting('scheduled_on');
                 }
             } catch (Exception $e) {
             }
             $nextUpdate = null;
             if ($scalarizr->candidate && $scalarizr->installed != $scalarizr->candidate) {
                 $nextUpdate = ['candidate' => htmlspecialchars($scalarizr->candidate), 'scheduledOn' => $scheduledOn ? Scalr_Util_DateTime::convertTzFromUTC($scheduledOn) : null];
             }
             return ['status' => htmlspecialchars($scalarizr->service_status), 'version' => htmlspecialchars($scalarizr->installed), 'candidate' => htmlspecialchars($scalarizr->candidate), 'repository' => Scalr::isHostedScalr() ? Utils::getScalarizrUpdateRepoTitle($scalarizr->repository) : ucfirst(htmlspecialchars($scalarizr->repository)), 'lastUpdate' => ['date' => $scalarizr->executed_at ? Scalr_Util_DateTime::convertTzFromUTC($scalarizr->executed_at) : "", 'error' => nl2br(htmlspecialchars($scalarizr->error))], 'nextUpdate' => $nextUpdate, 'fullInfo' => $scalarizr];
         } catch (Exception $e) {
             if (stristr($e->getMessage(), "Method not found")) {
                 return ['status' => 'statusNotAvailable', 'error' => "<span style='color:red;'>Scalarizr status is not available, because scalr-upd-client installed on this server is too old.</span>"];
             } else {
                 return ['status' => 'statusNotAvailable', 'error' => "<span style='color:red;'>Scalarizr status is not available: {$e->getMessage()}</span>"];
             }
         }
     }
 }
開發者ID:scalr,項目名稱:scalr,代碼行數:34,代碼來源:Servers.php


注:本文中的Scalr_Util_DateTime::convertTzFromUTC方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。