- Модуль: dav
- Путь к файлу: ~/bitrix/modules/dav/classes/general/groupdavclientresponse.php
- Класс: CDavGroupdavClientResponce
- Вызов: CDavGroupdavClientResponce::Parse
private function Parse()
{
if (empty($this->arDraftHeaders))
{
return;
}
// First line should be a HTTP status line (see http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6)
// Format is: HTTP-Version SP Status-Code SP Reason-Phrase CRLF
[$httpVersion, $statusCode, $reasonPhrase] = explode(' ', $this->arDraftHeaders[0], 3);
$this->arStatus = array(
'version' => $httpVersion,
'code' => $statusCode,
'phrase' => $reasonPhrase
);
// get the response header fields
// See http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6
for ($i = 1, $cnt = count($this->arDraftHeaders); $i < $cnt; $i++)
{
[$name, $value] = explode(':', $this->arDraftHeaders[$i]);
$name = mb_strtolower($name);
if (!array_key_exists($name, $this->arHeaders))
{
$this->arHeaders[$name] = trim($value);
}
elseif (is_array($this->arHeaders[$name]))
{
$this->arHeaders[$name][] = trim($value);
}
else
{
$ar = array($this->arHeaders[$name], trim($value));
$this->arHeaders[$name] = $ar;
}
}
}