| @@ 275-292 (lines=18) @@ | ||
| 272 | * |
|
| 273 | * @return Array Headers sent with request |
|
| 274 | */ |
|
| 275 | final public function getRequestHeaders() { |
|
| 276 | ||
| 277 | $headers = ''; |
|
| 278 | ||
| 279 | if (function_exists('getallheaders')) $headers = getallheaders(); |
|
| 280 | ||
| 281 | else { |
|
| 282 | ||
| 283 | foreach ($_SERVER as $name => $value) { |
|
| 284 | ||
| 285 | if (substr($name, 0, 5) == 'HTTP_') $headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value; |
|
| 286 | } |
|
| 287 | ||
| 288 | } |
|
| 289 | ||
| 290 | return $headers; |
|
| 291 | ||
| 292 | } |
|
| 293 | ||
| 294 | /** |
|
| 295 | * Process extra headers |
|
| @@ 42-60 (lines=19) @@ | ||
| 39 | * |
|
| 40 | * @return array |
|
| 41 | */ |
|
| 42 | private static function getHeaders() { |
|
| 43 | ||
| 44 | if ( function_exists('getallheaders') ) return getallheaders(); |
|
| 45 | ||
| 46 | $headers = array(); |
|
| 47 | ||
| 48 | foreach ( $_SERVER as $name => $value ) { |
|
| 49 | ||
| 50 | if ( substr($name, 0, 5) == 'HTTP_' ) { |
|
| 51 | ||
| 52 | $headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value; |
|
| 53 | ||
| 54 | } |
|
| 55 | ||
| 56 | } |
|
| 57 | ||
| 58 | return $headers; |
|
| 59 | ||
| 60 | } |
|
| 61 | ||
| 62 | } |
|
| 63 | ||