1 | <?php |
||
44 | class Environment |
||
45 | { |
||
46 | /** |
||
47 | * @var Param |
||
48 | */ |
||
49 | private $data; |
||
50 | |||
51 | /** |
||
52 | * @param array $server |
||
53 | */ |
||
54 | public function __construct(array $server) |
||
58 | |||
59 | /** |
||
60 | * @return Param |
||
61 | */ |
||
62 | public function data() |
||
66 | |||
67 | /** |
||
68 | * @param $key |
||
69 | * |
||
70 | * @return string |
||
71 | */ |
||
72 | public function __get($key) |
||
76 | |||
77 | /** |
||
78 | * Is this an AJAX request? |
||
79 | * |
||
80 | * @return bool |
||
81 | */ |
||
82 | public function isAjax() |
||
86 | |||
87 | /** |
||
88 | * Is the application running under HTTP protocol? |
||
89 | * |
||
90 | * @return bool |
||
91 | */ |
||
92 | public function isHttp() |
||
96 | |||
97 | /** |
||
98 | * Is the application running under HTTPS protocol? |
||
99 | * |
||
100 | * @return bool |
||
101 | */ |
||
102 | public function isHttps() |
||
106 | |||
107 | /** |
||
108 | * Get Host |
||
109 | * |
||
110 | * @return string |
||
111 | */ |
||
112 | public function getHost() |
||
127 | |||
128 | /** |
||
129 | * Get Host with Port |
||
130 | * |
||
131 | * @return string |
||
132 | */ |
||
133 | public function getHostWithPort() |
||
137 | |||
138 | /** |
||
139 | * Physical path + virtual path |
||
140 | * |
||
141 | * @return string |
||
142 | */ |
||
143 | public function getPath() |
||
147 | |||
148 | /** |
||
149 | * Get remote IP |
||
150 | * |
||
151 | * @return string |
||
152 | */ |
||
153 | public function getIp() |
||
169 | |||
170 | /** |
||
171 | * Get User Agent |
||
172 | * |
||
173 | * @return string|null |
||
174 | */ |
||
175 | public function getUserAgent() |
||
187 | |||
188 | /** |
||
189 | * Gives you the current page URL |
||
190 | * |
||
191 | * @return string |
||
192 | */ |
||
193 | public function getUrl() |
||
199 | |||
200 | /** |
||
201 | * Try to get a request header. |
||
202 | * |
||
203 | * @param string $header |
||
204 | * |
||
205 | * @return array |
||
206 | */ |
||
207 | public function getRequestHeader($header) |
||
219 | |||
220 | /** |
||
221 | * Try to determine all request headers |
||
222 | * |
||
223 | * @return array |
||
224 | */ |
||
225 | public function getRequestHeaders() |
||
237 | |||
238 | } |
||
239 |