You are here

function _background_process_request_headers in Background Process 7.2

Same name and namespace in other branches
  1. 8 background_process.module \_background_process_request_headers()
  2. 6 background_process.module \_background_process_request_headers()
  3. 7 background_process.module \_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.http.inc
Build url and headers for http request

File

./background_process.http.inc, line 451
This contains the HTTP functions for Background Process.

Code

function _background_process_request_headers() {
  foreach ($_SERVER as $key => $value) {
    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;
}