You are here

function _background_process_request_headers in Background Process 8

Same name and namespace in other branches
  1. 6 background_process.module \_background_process_request_headers()
  2. 7.2 background_process.http.inc \_background_process_request_headers()
  3. 7 background_process.module \_background_process_request_headers()

Get request headers.

1 call to _background_process_request_headers()
background_process_build_request in ./background_process.module
Implements to Build url and headers for http request.

File

./background_process.module, line 1323
This module implements a framework for calling funtions in the background.

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($key)) {
        $headers[$key] = $value;
      }
      else {
        $headers[$key] .= "; {$value}";
      }
    }
  }
  return $headers;
}