1 | <?php |
||
25 | class Descriptor |
||
26 | { |
||
27 | /** @var string the server name */ |
||
28 | private $host; |
||
29 | |||
30 | /** @var array a list of paths that exposes filesystem directories in the host context */ |
||
31 | private $paths; |
||
32 | |||
33 | /** |
||
34 | * Base constructor. |
||
35 | * |
||
36 | * @param string $host The host |
||
37 | * @param array $paths The paths |
||
38 | */ |
||
39 | 9 | public function __construct($host = '', array $paths = []) |
|
44 | |||
45 | /** |
||
46 | * Gets the served urls. |
||
47 | * |
||
48 | * @param string $path The path |
||
49 | * |
||
50 | * @return array The served urls |
||
51 | */ |
||
52 | 4 | public function getServedUrls($path) |
|
65 | |||
66 | /** |
||
67 | * Gets the exposed path. |
||
68 | * |
||
69 | * @param string $url The url |
||
70 | * |
||
71 | * @return string The exposed path |
||
72 | */ |
||
73 | 5 | public function getExposedPath($url) |
|
90 | |||
91 | /** |
||
92 | * Gets the relative path if it matches against another path. |
||
93 | * |
||
94 | * @param string $path The path |
||
95 | * @param string $against The path to match against |
||
96 | * |
||
97 | * @return null|string The relative path |
||
98 | */ |
||
99 | 8 | private function getRelative($path, $against) |
|
112 | |||
113 | /** |
||
114 | * Gets the host. |
||
115 | * |
||
116 | * @return string The starting uri based on the host |
||
117 | */ |
||
118 | 4 | protected function getHost() |
|
130 | |||
131 | /** |
||
132 | * Gets the uri host and path. |
||
133 | * |
||
134 | * @param string $url The url |
||
135 | * |
||
136 | * @return array The uri host and path |
||
137 | */ |
||
138 | 5 | private function getUriHostAndPath($url) |
|
161 | } |
||
162 |