本文整理匯總了PHP中CBXPunycode::toASCII方法的典型用法代碼示例。如果您正苦於以下問題:PHP CBXPunycode::toASCII方法的具體用法?PHP CBXPunycode::toASCII怎麽用?PHP CBXPunycode::toASCII使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CBXPunycode
的用法示例。
在下文中一共展示了CBXPunycode::toASCII方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: appendIBlockEntry
public function appendIBlockEntry($url, $modifiedDate, $priority = 0)
{
if ($this->isExists()) {
$this->appendEntry(array('XML_LOC' => $this->settings['PROTOCOL'] . '://' . \CBXPunycode::toASCII($this->settings['DOMAIN'], $e = null) . $url, 'XML_LASTMOD' => date('c', $modifiedDate - \CTimeZone::getOffset()), 'XML_PRIORITY' => $priority ? $priority : self::DEFAULT_PRIORITY));
} else {
$this->addHeader();
$this->addIBlockEntry($url, $modifiedDate, $priority);
$this->addFooter();
}
}
示例2: appendIndexEntry
public function appendIndexEntry($file)
{
if ($this->isExists()) {
$fileUrlEnc = Converter::getXmlConverter()->encode($this->settings['PROTOCOL'] . '://' . \CBXPunycode::toASCII($this->settings['DOMAIN'], $e = null) . $this->getFileUrl($file));
$contents = $this->getContents();
$reg = "/" . sprintf(preg_quote(self::ENTRY_TPL, "/"), preg_quote($fileUrlEnc, "/"), "[^<]*") . "/";
$newEntry = sprintf(self::ENTRY_TPL, $fileUrlEnc, date(c, $file->getModificationTime($file)));
$count = 0;
$contents = preg_replace($reg, $newEntry, $contents, 1, $count);
if ($count <= 0) {
$contents = substr($contents, 0, -strlen(self::FILE_FOOTER)) . $newEntry . self::FILE_FOOTER;
}
$this->putContents($contents);
} else {
$this->createIndex(array($file));
}
}
示例3: getUrl
/**
* Returns sitemap file URL
*
* @return string
*/
public function getUrl()
{
return $this->settings['PROTOCOL'].'://'.\CBXPunycode::toASCII($this->settings['DOMAIN'], $e = null).$this->getFileUrl($this);
}
示例4: processSiteResult
protected function processSiteResult($res)
{
$obXml = new \CDataXML();
if ($obXml->loadString($res)) {
$hostName = $obXml->getTree()->elementsByName('name');
$hostName = \CBXPunycode::toASCII(ToLower($hostName[0]->textContent()), $e = null);
if (preg_match("/^https:\\/\\//", $hostName)) {
$hostName = substr($hostName, 8);
}
$this->engineSettings['SITES'][$hostName]['SERVICES'] = array();
$arLinks = $obXml->getTree()->elementsByName('link');
foreach ($arLinks as $link) {
$this->engineSettings['SITES'][$hostName]['SERVICES'][$link->getAttribute('rel')] = $link->getAttribute('href');
}
$this->saveSettings();
return true;
}
return false;
}
示例5: getFeeds
public function getFeeds()
{
$queryResult = $this->queryJson(self::QUERY_BASE . self::SCOPE_FEED_SITES);
if ($queryResult->getStatus() == self::HTTP_STATUS_OK && strlen($queryResult->getResult()) > 0) {
$result = Json::decode($queryResult->getResult());
$response = array();
if (is_array($result)) {
foreach ($result['siteEntry'] as $key => $siteInfo) {
$siteUrlInfo = parse_url($siteInfo['siteUrl']);
if ($siteUrlInfo) {
$errors = array();
$hostKey = \CBXPunycode::toASCII($siteUrlInfo["host"], $errors);
if (count($errors) > 0) {
$hostKey = $siteUrlInfo["host"];
}
$response[$hostKey] = array('binded' => $siteInfo["permissionLevel"] !== "siteRestrictedUser", 'verified' => $siteInfo["permissionLevel"] !== "siteRestrictedUser" && $siteInfo["permissionLevel"] !== "siteUnverifiedUser");
}
}
}
return $response;
} else {
throw new \Exception('Query error! ' . $queryResult->getStatus() . ': ' . $queryResult->getResult());
}
}