Fr3nch13/CakePHP Utilities

normalize_server.php

Table of Contents

Functions

normalizeServer()  : array<string|int, mixed>
Marshal the $_SERVER array

Functions

normalizeServer()

Marshal the $_SERVER array

normalizeServer(array<string|int, mixed> $server[, null|callable $apacheRequestHeaderCallback = null ]) : array<string|int, mixed>

Pre-processes and returns the $_SERVER superglobal. In particularly, it attempts to detect the Authorization header, which is often not aggregated correctly under various SAPI/httpd combinations.

Parameters
$server : array<string|int, mixed>
$apacheRequestHeaderCallback : null|callable = null

Callback that can be used to retrieve Apache request headers. This defaults to apache_request_headers under the Apache mod_php.

Return values
array<string|int, mixed>

Either $server verbatim, or with an added HTTP_AUTHORIZATION header.


        
On this page

Search results