| Conditions | 9 |
| Paths | 3 |
| Total Lines | 34 |
| Code Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 42 | * Declaring here for Nginx server |
||
| 43 | * @return array |
||
| 44 | */ |
||
| 45 | function getallheaders(): array |
||
| 46 | { |
||
| 47 | $server = new Server(); |
||
| 48 | |||
| 49 | $data = $server->all(); |
||
| 50 | |||
| 51 | if (empty($data)) { |
||
| 52 | return []; |
||
| 53 | } |
||
| 54 | |||
| 55 | $headers = []; |
||
| 56 | |||
| 57 | foreach ($data as $key => $value) { |
||
| 58 | if (substr($key, 0, 5) == 'HTTP_') { |
||
| 59 | $headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($key, 5)))))] = $value; |
||
| 60 | } |
||
| 61 | } |
||
| 62 | |||
| 63 | return $headers; |
||
| 64 | } |
||
| 65 | |||
| 66 | } |
||
| 67 |