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