1 | <?php |
||
17 | class Uri |
||
18 | { |
||
19 | /** |
||
20 | * @var ServerBag |
||
21 | */ |
||
22 | private $server; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | private $pathInfo; |
||
28 | |||
29 | /** |
||
30 | * @var string |
||
31 | */ |
||
32 | private $baseUri; |
||
33 | |||
34 | /** |
||
35 | * @var string |
||
36 | */ |
||
37 | private $basePath; |
||
38 | |||
39 | /** |
||
40 | * @var array |
||
41 | */ |
||
42 | private $segments; |
||
43 | |||
44 | /** |
||
45 | * Constructor. |
||
46 | * |
||
47 | * @param ServerBag $server |
||
48 | */ |
||
49 | public function __construct(ServerBag $server) |
||
55 | |||
56 | /** |
||
57 | * Get all segment. |
||
58 | * |
||
59 | * @return array |
||
60 | */ |
||
61 | public function allSegments() |
||
65 | |||
66 | /** |
||
67 | * Get uri segment. |
||
68 | * |
||
69 | * @param int $index |
||
70 | * @param mixed $default |
||
71 | * |
||
72 | * @return string|mixed |
||
73 | */ |
||
74 | public function getSegment($index, $default = null) |
||
82 | |||
83 | /** |
||
84 | * Filter uri segment. |
||
85 | * |
||
86 | * @param int $index |
||
87 | * @param int $filter |
||
88 | * @param mixed $default |
||
89 | * @param array|null $options |
||
90 | * |
||
91 | * @return mixed |
||
92 | */ |
||
93 | public function filterSegment($index, $filter = FILTER_DEFAULT, $default = null, array $options = null) |
||
99 | |||
100 | /** |
||
101 | * Get path info. |
||
102 | * |
||
103 | * @return string |
||
104 | */ |
||
105 | public function getPathInfo() |
||
130 | |||
131 | /** |
||
132 | * Get uri for specified path. |
||
133 | * |
||
134 | * @param string $path |
||
135 | * |
||
136 | * @return string |
||
137 | */ |
||
138 | public function getUriForPath($path) |
||
142 | |||
143 | /** |
||
144 | * Get uri. |
||
145 | * |
||
146 | * @return string |
||
147 | */ |
||
148 | public function getUri() |
||
188 | |||
189 | /** |
||
190 | * Get base path. |
||
191 | * |
||
192 | * @return string |
||
193 | */ |
||
194 | public function getBasePath() |
||
214 | |||
215 | /** |
||
216 | * Get request uri. |
||
217 | * |
||
218 | * @return string |
||
219 | */ |
||
220 | public function getRequestUri() |
||
224 | } |
||
225 |