1 | <?php |
||
10 | class UriFactory implements UriFactoryInterface |
||
11 | { |
||
12 | /** |
||
13 | * Factory method to build a URI from a super-global $_SERVER array. |
||
14 | * |
||
15 | * @param array $_server |
||
16 | * |
||
17 | * @return UriInterface |
||
18 | */ |
||
19 | public function createFromSuperGlobalArray(array $_server) |
||
33 | |||
34 | /** |
||
35 | * @param string $absoluteUri |
||
36 | * |
||
37 | * @return UriInterface |
||
38 | */ |
||
39 | public function createFromAbsolute($absoluteUri) |
||
43 | |||
44 | /** |
||
45 | * Factory method to build a URI from parts |
||
46 | * |
||
47 | * @param string $scheme |
||
48 | * @param string $userInfo |
||
49 | * @param string $host |
||
50 | * @param string $port |
||
51 | * @param string $path |
||
52 | * @param string $query |
||
53 | * @param string $fragment |
||
54 | * |
||
55 | * @return UriInterface |
||
56 | */ |
||
57 | public function createFromParts($scheme, $userInfo, $host, $port, $path = '', $query = '', $fragment = '') |
||
70 | |||
71 | /** |
||
72 | * @param array $_server |
||
73 | * |
||
74 | * @return UriInterface|null |
||
75 | */ |
||
76 | private function attemptProxyStyleParse($_server) |
||
87 | |||
88 | /** |
||
89 | * @param array $_server |
||
90 | * |
||
91 | * @return string |
||
92 | * |
||
93 | * @throws RuntimeException |
||
94 | */ |
||
95 | private function detectPath($_server) |
||
112 | |||
113 | /** |
||
114 | * @param array $_server |
||
115 | * |
||
116 | * @return string |
||
117 | */ |
||
118 | private function detectHost(array $_server) |
||
128 | |||
129 | /** |
||
130 | * @param array $_server |
||
131 | * |
||
132 | * @return string |
||
133 | */ |
||
134 | private function detectPort(array $_server) |
||
138 | |||
139 | /** |
||
140 | * @param array $_server |
||
141 | * |
||
142 | * @return string |
||
143 | */ |
||
144 | private function detectQuery(array $_server) |
||
148 | |||
149 | /** |
||
150 | * Determine URI scheme component from superglobal array |
||
151 | * |
||
152 | * When using ISAPI with IIS, the value will be "off" if the request was |
||
153 | * not made through the HTTPS protocol. As a result, we filter the |
||
154 | * value to a bool. |
||
155 | * |
||
156 | * @param array $_server A super-global $_SERVER array |
||
157 | * |
||
158 | * @return string Returns http or https depending on the URI scheme |
||
159 | */ |
||
160 | private function detectScheme(array $_server) |
||
168 | } |
||
169 |