本文整理汇总了PHP中CBXPunycode::GetConverter方法的典型用法代码示例。如果您正苦于以下问题:PHP CBXPunycode::GetConverter方法的具体用法?PHP CBXPunycode::GetConverter怎么用?PHP CBXPunycode::GetConverter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBXPunycode
的用法示例。
在下文中一共展示了CBXPunycode::GetConverter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getConfiguredDomains
public function getConfiguredDomains()
{
$result = array();
$converter = CBXPunycode::GetConverter();
$domainName = COption::GetOptionString("main", "server_name", "");
if ($domainName != "") {
$result[$domainName] = $domainName;
}
$by = "";
$order = "";
$siteList = CSite::GetList($by, $order, array("ACTIVE" => "Y"));
while ($site = $siteList->Fetch()) {
$domains = explode("\r\n", $site["DOMAINS"]);
foreach ($domains as $domainName) {
if ($domainName != "") {
$punyName = $converter->Encode($domainName);
if ($punyName !== false) {
$result[$punyName] = $domainName;
}
}
}
}
ksort($result);
return $result;
}
示例2: array
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
$APPLICATION->SetAdditionalCSS('/bitrix/gadgets/bitrix/bitrixcloud_monitoring/styles.css');
$converter = CBXPunycode::GetConverter();
$saleIncluded = CModule::IncludeModule('sale');
$intervalLang = array("sale" => array(7 => GetMessage("GD_BITRIXCLOUD_MONITOR_MESS_ALERT1_WEEK"), 30 => GetMessage("GD_BITRIXCLOUD_MONITOR_MESS_ALERT1_MONTH"), 90 => GetMessage("GD_BITRIXCLOUD_MONITOR_MESS_ALERT1_QUARTER"), 365 => GetMessage("GD_BITRIXCLOUD_MONITOR_MESS_ALERT1_YEAR")), "uptime" => array(7 => GetMessage("GD_BITRIXCLOUD_MONITOR_MESS_ALERT2_WEEK"), 30 => GetMessage("GD_BITRIXCLOUD_MONITOR_MESS_ALERT2_MONTH"), 90 => GetMessage("GD_BITRIXCLOUD_MONITOR_MESS_ALERT2_QUARTER"), 365 => GetMessage("GD_BITRIXCLOUD_MONITOR_MESS_ALERT2_YEAR")));
$uptime = "";
$testCount = 0;
/** @var CBitrixCloudMonitoringTest $testAlert */
$testAlert = null;
$testDomain = "";
$bAlert = false;
if (CModule::IncludeModule('bitrixcloud')) {
$monitoring = CBitrixCloudMonitoring::getInstance();
$monitoringResults = $monitoring->getMonitoringResults();
if (!is_string($monitoringResults)) {
if ($monitoringResults->getStatus() === CBitrixCloudMonitoringResult::RED_LAMP) {
$bAlert = true;
foreach ($monitoringResults as $domainName => $domainResult) {
foreach ($domainResult as $testId => $testResult) {
if ($testResult->getStatus() === CBitrixCloudMonitoringResult::RED_LAMP) {
$testCount++;
$testAlert = $testResult;
$testDomain = $domainName;
}
}
}
$uptime = $monitoring->getWorstUptime("test_http_response_time");
示例3: URLEncode
function URLEncode($str, $charset)
{
global $APPLICATION;
$strEncodedURL = '';
$arUrlComponents = preg_split("#(://|/|\\?|=|&)#", $str, -1, PREG_SPLIT_DELIM_CAPTURE);
foreach ($arUrlComponents as $i => $part_of_url) {
if ($i % 2) {
$strEncodedURL .= $part_of_url;
} else {
if ($i > 1 && $arUrlComponents[$i - 1] === "://") {
$converter = CBXPunycode::GetConverter();
$strEncodedURL .= $converter->Encode($part_of_url);
} else {
$strEncodedURL .= urlencode($APPLICATION->ConvertCharset(urldecode($part_of_url), LANG_CHARSET, $charset));
}
}
}
return $strEncodedURL;
}