• Модуль: rest
  • Путь к файлу: ~/bitrix/modules/rest/classes/general/rest.php
  • Класс: CRestServer
  • Вызов: CRestServer::init
private function init()
{
	if(!in_array($this->transport, array('json', 'xml')))
	{
		throw new RestException('Wrong transport!', RestException::ERROR_INTERNAL_WRONG_TRANSPORT, self::STATUS_INTERNAL);
	}
	elseif(!$this->checkSite())
	{
		throw new RestException('Portal was deleted', RestException::ERROR_INTERNAL_PORTAL_DELETED, self::STATUS_FORBIDDEN);
	}
	elseif(!class_exists($this->class) || !method_exists($this->class, 'getDescription'))
	{
		throw new RestException('Wrong handler class!', RestException::ERROR_INTERNAL_WRONG_HANDLER_CLASS, self::STATUS_INTERNAL);
	}
	else
	{
		if(array_key_exists("state", $this->query))
		{
			$this->securityClientState = $this->query["state"];
			unset($this->query["state"]);
		}
	}

	return true;
}