1: <?php
2:
3: namespace Deimos\Request\Adapter;
4:
5: trait Server
6: {
7:
8: /**
9: * @var array
10: */
11: private $serverData;
12:
13: /**
14: * @param string $path
15: * @param mixed $default
16: *
17: * @return mixed
18: */
19: public function server($path = null, $default = null)
20: {
21: $path = $this->normalizeUpp($path);
22:
23: return $this->arrGet($this->serverData(), $path, $default);
24: }
25:
26: /**
27: * @return array
28: */
29: private function serverData()
30: {
31: if (!$this->serverData)
32: {
33: $this->serverData = $this->inputArray(INPUT_SERVER);
34: }
35:
36: return $this->serverData;
37: }
38:
39: }