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