Total Complexity | 17 |
Total Lines | 54 |
Duplicated Lines | 0 % |
Changes | 8 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
4 | final class Request extends \WebServCo\Framework\AbstractRequest |
||
5 | { |
||
6 | public function __construct($config, $server, $post = []) |
||
7 | { |
||
8 | parent::__construct($config); |
||
9 | |||
10 | $this->init($server, $post); |
||
11 | } |
||
12 | |||
13 | public function getSchema() |
||
14 | { |
||
15 | if (\WebServCo\Framework\Framework::isCLI()) { |
||
16 | return null; |
||
17 | } |
||
18 | |||
19 | if (isset($this->server['HTTPS']) && 'off' != $this->server['HTTPS']) { |
||
20 | return 'https'; |
||
21 | } elseif (isset($this->server['HTTP_X_FORWARDED_PROTO']) && |
||
22 | 'https' == $this->server['HTTP_X_FORWARDED_PROTO']) { |
||
23 | return 'https'; |
||
24 | } elseif (isset($this->server['HTTP_X_FORWARDED_SSL']) && |
||
25 | 'on' == $this->server['HTTP_X_FORWARDED_SSL']) { |
||
26 | return 'https'; |
||
27 | } |
||
28 | return 'http'; |
||
29 | } |
||
30 | |||
31 | public function getReferer() |
||
32 | { |
||
33 | return isset($this->server['HTTP_REFERER']) ? $this->server['HTTP_REFERER'] : null; |
||
34 | } |
||
35 | |||
36 | public function getHost() |
||
46 | } |
||
47 | |||
48 | public function guessAppUrl() |
||
58 | } |
||
59 | } |
||
60 |