- Модуль: seo
- Путь к файлу: ~/bitrix/modules/seo/classes/general/seo_page_checker.php
- Класс: CSeoPageChecker
- Вызов: CSeoPageChecker::__construct
public function __construct($site, $url, $get = true, $check_errors = true)
{
global $APPLICATION;
if (CModule::IncludeModule('search'))
$this->bSearch = true;
else
$APPLICATION->ThrowException(GetMessage('SEO_ERROR_NO_SEARCH')); // don't return false or set bError!
$this->__bCheckErrors = $check_errors;
$this->__site = $site;
$dbRes = CSite::GetByID($this->__site);
if ($arRes = $dbRes->Fetch())
{
$this->__lang = $arRes['LANGUAGE_ID'];
$this->__server_name = $arRes['SERVER_NAME'];
if ($this->__server_name == '')
$this->__server_name = COption::GetOptionString('main', 'server_name', '');
if ($this->__server_name <> '')
{
$this->__url = (CMain::IsHTTPS() ? "https://" : "http://")
.CBXPunycode::ToASCII($this->__server_name, $e)
.$url;
if(!$get || $this->GetHTTPData())
return true;
if($this->bError && $this->errorString <> '')
$APPLICATION->ThrowException($this->errorString);
return false;
}
else
{
$this->bError = true;
$APPLICATION->ThrowException(str_replace('#SITE_ID#', $this->__site, GetMessage('SEO_ERROR_NO_SERVER_NAME')));
return false;
}
}
return false;
}