Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
responsebuilder.php
1
<?php
2
10
namespace
Bitrix\Main\Web\Http
;
11
12
use
Bitrix\Main\Web\HttpHeaders
;
13
14
class
ResponseBuilder
15
{
20
public
function
createFromString
(
string
$response):
Response
21
{
22
$headers =
HttpHeaders::createFromString
($response);
23
$body = $this->
createBody
();
24
25
if
(strtolower($headers->get(
'Transfer-Encoding'
) ??
''
) ==
'chunked'
)
26
{
27
$body =
new
DechunkStream
($body);
28
}
29
30
if
(strtolower($headers->get(
'Content-Encoding'
) ??
''
) ==
'gzip'
)
31
{
32
$body =
new
InflateStream
($body);
33
}
34
35
return
new
Response
($headers->getStatus(), $headers->getHeaders(), $body, $headers->getVersion(), $headers->getReasonPhrase());
36
}
37
38
protected
function
createBody
():
Stream
39
{
40
return
new
Stream
(
'php://temp'
,
'r+'
);
41
}
42
}
Bitrix\Main\Response
Definition
response.php:5
Bitrix\Main\Web\Http\DechunkStream
Definition
dechunkstream.php:6
Bitrix\Main\Web\Http\InflateStream
Definition
inflatestream.php:6
Bitrix\Main\Web\Http\ResponseBuilder
Definition
responsebuilder.php:15
Bitrix\Main\Web\Http\ResponseBuilder\createFromString
createFromString(string $response)
Definition
responsebuilder.php:20
Bitrix\Main\Web\Http\ResponseBuilder\createBody
createBody()
Definition
responsebuilder.php:38
Bitrix\Main\Web\Http\Stream
Definition
stream.php:9
Bitrix\Main\Web\HttpHeaders
Definition
httpheaders.php:18
Bitrix\Main\Web\HttpHeaders\createFromString
static createFromString(string $response)
Definition
httpheaders.php:391
Bitrix\Main\Web\Http
Definition
clientexception.php:3
modules
main
lib
web
http
responsebuilder.php
Создано системой
1.10.0