当前位置: 首页>>代码示例>>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;未经允许,请勿转载。