function _background_process_request_headers in Background Process 7
Same name and namespace in other branches
- 8 background_process.module \_background_process_request_headers()
- 6 background_process.module \_background_process_request_headers()
- 7.2 background_process.http.inc \_background_process_request_headers()
Get request headers.
Return value
array Headers.
1 call to _background_process_request_headers()
- background_process_build_request in ./
background_process.module - Build url and headers for http request.
File
- ./
background_process.module, line 1536
Code
function _background_process_request_headers() {
foreach ($_SERVER as $key => $value) {
if (empty($value)) {
continue;
}
if (substr($key, 0, 5) == 'HTTP_') {
$key = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($key, 5)))));
if (empty($headers[$key])) {
$headers[$key] = $value;
}
else {
$headers[$key] .= "; {$value}";
}
}
}
return $headers;
}