1 | <?php |
||
10 | class AppManager |
||
11 | { |
||
12 | use Macroable; |
||
13 | |||
14 | /** |
||
15 | * The container instance. |
||
16 | * |
||
17 | * @var \Illuminate\Contracts\Container\Container |
||
18 | */ |
||
19 | protected $container; |
||
20 | |||
21 | /** |
||
22 | * The current application identifier. |
||
23 | * |
||
24 | * @var string|false |
||
25 | */ |
||
26 | protected $id = false; |
||
27 | |||
28 | /** |
||
29 | * Create a new app manager instance. |
||
30 | * |
||
31 | * @param \Illuminate\Contracts\Container\Container $container |
||
32 | */ |
||
33 | 11 | public function __construct(Container $container) |
|
41 | |||
42 | /** |
||
43 | * Get or check the current application identifier. |
||
44 | * |
||
45 | * @return string|bool |
||
46 | */ |
||
47 | 3 | public function id() |
|
59 | |||
60 | /** |
||
61 | * Refresh the current application identifier. |
||
62 | * |
||
63 | * @return $this |
||
64 | */ |
||
65 | 2 | public function refreshId() |
|
71 | |||
72 | /** |
||
73 | * Get application identifier for the given URL. |
||
74 | * |
||
75 | * @param string $url |
||
76 | * @return string |
||
77 | */ |
||
78 | 4 | public function idForUrl($url) |
|
90 | |||
91 | /** |
||
92 | * Determine if an URL has the given root URL. |
||
93 | * |
||
94 | * @param string $url |
||
95 | * @param string $root |
||
96 | * @param bool $strict |
||
97 | * @return bool |
||
98 | */ |
||
99 | 4 | protected function urlHasRoot($url, $root, $strict = false) |
|
108 | |||
109 | /** |
||
110 | * Remove scheme for an URL. |
||
111 | * |
||
112 | * @param string $url |
||
113 | * @return string |
||
114 | */ |
||
115 | 4 | protected function removeScheme($url) |
|
119 | |||
120 | /** |
||
121 | * Get the root URL for the given application identifier. |
||
122 | * |
||
123 | * @param string $appId |
||
124 | * @return string |
||
125 | */ |
||
126 | 4 | public function root($appId = '') |
|
131 | |||
132 | /** |
||
133 | * Get the domain for the given application identifier. |
||
134 | * |
||
135 | * @param string $appId |
||
136 | * @return string |
||
137 | */ |
||
138 | 1 | public function domain($appId = '') |
|
142 | |||
143 | /** |
||
144 | * Get the URL prefix for the given application identifier. |
||
145 | * |
||
146 | * @param string $appId |
||
147 | * @return string |
||
148 | */ |
||
149 | 1 | public function prefix($appId = '') |
|
153 | |||
154 | /** |
||
155 | * Generate an absolute URL to a path for the given application identifier. |
||
156 | * |
||
157 | * @param string $appId |
||
158 | * @param string $path |
||
159 | * @param mixed $extra |
||
160 | * @return string |
||
161 | */ |
||
162 | 1 | public function url($appId = '', $path = '', $extra = []) |
|
169 | |||
170 | /** |
||
171 | * Return the remainder of a string after a given value. |
||
172 | * |
||
173 | * @param string $subject |
||
174 | * @param string $search |
||
175 | * @return string |
||
176 | */ |
||
177 | 1 | protected function stringAfter($subject, $search) |
|
181 | |||
182 | /** |
||
183 | * Register routes for each sub application. |
||
184 | * |
||
185 | * @param array $attributes |
||
186 | * @return void |
||
187 | */ |
||
188 | public function routes(array $attributes = []) |
||
203 | |||
204 | /** |
||
205 | * Get route group attributes for the given application identifier. |
||
206 | * |
||
207 | * @param string $appId |
||
208 | * @param array $attributes |
||
209 | * @return array |
||
210 | */ |
||
211 | protected function getRouteGroupAttributes($appId, array $attributes = []) |
||
225 | |||
226 | /** |
||
227 | * Get the root controller namespace. |
||
228 | * |
||
229 | * @return string |
||
230 | */ |
||
231 | protected function getRootControllerNamespace() |
||
239 | } |
||
240 |