YoastSEO_Vendor\GuzzleHttp\Psr7
ServerRequest::fromGlobals() public Yoast 1.0
Return a ServerRequest populated with superglobals: $_GET $_POST $_COOKIE $_FILES $_SERVER
{} Это метод класса: ServerRequest{}
Хуков нет.
Возвращает
ServerRequestInterface
. Ничего.
Использование
$result = ServerRequest::fromGlobals();
Код ServerRequest::fromGlobals() ServerRequest::fromGlobals Yoast 16.1.1
public static function fromGlobals()
{
$method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET';
$headers = \getallheaders();
$uri = self::getUriFromGlobals();
$body = new \YoastSEO_Vendor\GuzzleHttp\Psr7\LazyOpenStream('php://input', 'r+');
$protocol = isset($_SERVER['SERVER_PROTOCOL']) ? \str_replace('HTTP/', '', $_SERVER['SERVER_PROTOCOL']) : '1.1';
$serverRequest = new \YoastSEO_Vendor\GuzzleHttp\Psr7\ServerRequest($method, $uri, $headers, $body, $protocol, $_SERVER);
return $serverRequest->withCookieParams($_COOKIE)->withQueryParams($_GET)->withParsedBody($_POST)->withUploadedFiles(self::normalizeFiles($_FILES));
}