本文整理汇总了PHP中SEFTools::getSubdomain方法的典型用法代码示例。如果您正苦于以下问题:PHP SEFTools::getSubdomain方法的具体用法?PHP SEFTools::getSubdomain怎么用?PHP SEFTools::getSubdomain使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SEFTools
的用法示例。
在下文中一共展示了SEFTools::getSubdomain方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: build
//.........这里部分代码省略.........
if (is_object($data) && is_a($data, 'JURI')) {
// Backwards compatibility
JoomSefUri::copyUri($data, $uri);
} else {
if ($sefConfig->langPlacementJoomla == _COM_SEF_LANG_PATH) {
// if data is not array, then we don't have in lang language from SEF extension, because it's original URL
if (is_array($data)) {
if ($data['lang'] == '*') {
// If we don't want to have language in multilanguage content strip down the language from path to eleminate duplicit pages with same content
if ($sefConfig->addLangMulti) {
$data["lang"] = $data["uri"]->getVar('lang');
} else {
unset($data["lang"]);
$data["uri"]->delVar('lang');
}
} else {
$langs = JLanguageHelper::getLanguages('lang_code');
if (array_key_exists($data["lang"], $langs)) {
$data["lang"] = $langs[$data["lang"]]->sef;
}
if (!strlen($data["lang"])) {
$data["lang"] = $data["uri"]->getVar('lang');
}
}
}
if ($sefConfig->alwaysUseLangJoomla == false) {
if (isset($data["lang"]) && $data["lang"] == $sefConfig->mainLanguageJoomla) {
unset($data["lang"]);
$data["uri"]->delVar('lang');
}
}
}
$titlepage = false;
$subdomain = SEFTools::getSubdomain($uri->getVar('Itemid'), $uri, $titlepage);
if (strlen($subdomain)) {
$curHost = JFactory::getURI()->getHost();
if (substr($curHost, 0, 4) == 'www.') {
$curHost = substr($curHost, 4);
}
$uri->setHost($subdomain . '.' . $curHost);
}
if ($titlepage) {
$data["title"] = array();
}
if (!isset($data["host"])) {
$data["host"] = $uri->getHost();
}
if ($check) {
$this->_data = $data;
}
// 12.11.2012 dajo: Itemid must be removed in _storeLocation after the menu title is removed too
/*if (isset($sefConfig->excludeSource) && $sefConfig->excludeSource && ($override == '0')) {
if (isset($data['uri'])) {
$data['uri']->delVar('Itemid');
}
}*/
$removeItemid = isset($sefConfig->excludeSource) && $sefConfig->excludeSource && $override == '0';
JoomSefUri::copyUri(JoomSEF::_storeLocation($data, $check, $removeItemid), $uri);
}
} else {
// if SEF is disabled, don't SEF
if (isset($sefUrl->sef) && !$sefUrl->sef) {
$uri = JoomSEF::_createUri($uri);
JoomSEF::_endSef($prevLang);
$jRouter->SetMode(JROUTER_MODE_RAW);
return;
示例2: build
//.........这里部分代码省略.........
// override Itemid if set to
$override = $params->get('itemid', '0');
$overrideId = $params->get('overrideId', '');
if ($override != '0' && $overrideId != '') {
$uri->setVar('Itemid', $overrideId);
}
// clean Itemid if desired
// David: only if overriding is disabled
if (isset($sefConfig->excludeSource) && $sefConfig->excludeSource && $override == '0') {
$Itemid = $uri->getVar('Itemid');
$uri->delVar('Itemid');
}
// Get nonsef and ignore vars from extension
list($nonSefVars, $ignoreVars) = $sef_ext->getNonSefVars($uri);
// Create array of all the non sef vars
$nonSefVars = SEFTools::getNonSefVars($uri, $nonSefVars, $ignoreVars);
// Create a copy of JURI object
$uri2 = clone $uri;
// Remove nonsef variables from our JURI copy
$nonSefUrl = SEFTools::RemoveVariables($uri2, array_keys($nonSefVars));
// Check homepage
if (JoomSEF::_isHomePage($uri2, true)) {
// Create homepage SEF URL without non-SEF variables
$title = array();
$data = JoomSEF::_sefGetLocation($uri2, $title, null, null, null, $uri->getVar('lang'));
$uri = JoomSEF::_storeLocation($data);
// Add non-SEF variables
$uri->setQuery($nonSefUrl);
JoomSEF::_endSef($prevLang);
return;
}
if (!SEFTools::JoomFishInstalled()) {
$titlepage = false;
$subdomain = SEFTools::getSubdomain($origUri, $titlepage);
if (strlen($subdomain)) {
$uri->setHost($subdomain . "." . JFactory::getURI()->getHost());
}
}
$url = JoomSEF::_uriToUrl($uri2);
// try to get url from cache
$sefUrl = false;
if ($sefConfig->useCache) {
$sefUrl = $cache->GetSefUrl($url);
}
if (!$sefConfig->useCache || !$sefUrl) {
// check if the url is already saved in the database
$sefUrl = $sef_ext->getSefUrlFromDatabase($uri2);
if (is_string($sefUrl)) {
// Backward compatibility
$sefstring = $sefUrl;
$sefUrl = new stdClass();
$sefUrl->sefurl = $sefstring;
$sefUrl->sef = 1;
}
}
if (!$sefUrl) {
// rewrite the URL, creating new JURI object
$data = $sef_ext->create($uri);
if (is_object($data) && is_a($data, 'JURI')) {
// Backwards compatibility
$uri = $data;
} else {
// Handle subdomains
if (!SEFTools::JoomFishInstalled()) {
if (!isset($data["host"])) {
$comp_host = $sef_ext->getParam('subdomain');