| Total Complexity | 18 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 4 | trait RequestServerTrait |
||
| 5 | { |
||
| 6 | public function getAcceptLanguage() |
||
| 12 | } |
||
| 13 | |||
| 14 | public function getHost() |
||
| 24 | } |
||
| 25 | |||
| 26 | public function getReferer() |
||
| 27 | { |
||
| 28 | return isset($this->server['HTTP_REFERER']) ? $this->server['HTTP_REFERER'] : null; |
||
| 29 | } |
||
| 30 | |||
| 31 | public function getSchema() |
||
| 32 | { |
||
| 33 | if (\WebServCo\Framework\Framework::isCLI()) { |
||
| 34 | return null; |
||
| 35 | } |
||
| 36 | |||
| 37 | if (isset($this->server['HTTPS']) && 'off' != $this->server['HTTPS']) { |
||
| 38 | return 'https'; |
||
| 39 | } elseif (isset($this->server['HTTP_X_FORWARDED_PROTO']) && |
||
| 40 | 'https' == $this->server['HTTP_X_FORWARDED_PROTO']) { |
||
| 41 | return 'https'; |
||
| 42 | } elseif (isset($this->server['HTTP_X_FORWARDED_SSL']) && |
||
| 43 | 'on' == $this->server['HTTP_X_FORWARDED_SSL']) { |
||
| 44 | return 'https'; |
||
| 45 | } |
||
| 46 | return 'http'; |
||
| 47 | } |
||
| 48 | |||
| 49 | public function getServerProtocol() |
||
| 55 | } |
||
| 56 | } |
||
| 57 |