1 | <?php |
||
23 | abstract class AbstractAdapter implements ServiceInterface |
||
24 | { |
||
25 | /** @var ConfigurationInterface */ |
||
26 | protected $configuration; |
||
27 | /** @var string */ |
||
28 | protected $url; |
||
29 | /** @var string */ |
||
30 | protected $subDomain; |
||
31 | /** @var string */ |
||
32 | protected $topDomain; |
||
33 | /** @var string */ |
||
34 | protected $applicationDomain; |
||
35 | /** @var string */ |
||
36 | protected $documentRoot; |
||
37 | /** @var string */ |
||
38 | protected $applicationRoot; |
||
39 | /** @var string */ |
||
40 | protected $selectedModule; |
||
41 | /** @var string */ |
||
42 | protected $selectedApplication; |
||
43 | /** @var string */ |
||
44 | protected $selectedApplicationUri; |
||
45 | /** @var string */ |
||
46 | protected $selectedTheme; |
||
47 | /** @var string */ |
||
48 | protected $selectedThemeResourcePath; |
||
49 | /** @var array */ |
||
50 | protected $environmentData; |
||
51 | /** @var bool */ |
||
52 | protected $isHttps; |
||
53 | /** @var array */ |
||
54 | protected $options = []; |
||
55 | |||
56 | /** |
||
57 | * ServiceAdapter constructor. |
||
58 | * |
||
59 | * @param ConfigurationInterface $configuration |
||
60 | * @param array $getData |
||
61 | * @param array $postData |
||
62 | * @param array $serverData |
||
63 | * @param array $cookieData |
||
64 | * @param array $filesData |
||
65 | * @param array $optionsData |
||
66 | * @throws Exception |
||
67 | */ |
||
68 | abstract public function __construct( |
||
77 | |||
78 | /** |
||
79 | * Gets the document root path. |
||
80 | * |
||
81 | * @return string |
||
82 | */ |
||
83 | 11 | public function getDocumentRoot() : string |
|
87 | |||
88 | /** |
||
89 | * Gets the application path. |
||
90 | * |
||
91 | * @return string |
||
92 | */ |
||
93 | 6 | public function getApplicationRoot(): string |
|
97 | |||
98 | /** |
||
99 | * Gets the application domain. |
||
100 | * |
||
101 | * @return string |
||
102 | */ |
||
103 | 4 | public function getApplicationDomain() : string |
|
107 | |||
108 | /** |
||
109 | * Gets the top domain. |
||
110 | * |
||
111 | * @return string |
||
112 | */ |
||
113 | 3 | public function getTopDomain() : string |
|
117 | |||
118 | /** |
||
119 | * Gets the application SSL status. |
||
120 | * |
||
121 | * @return bool |
||
122 | */ |
||
123 | 19 | public function isSecuredApplication() : bool |
|
127 | |||
128 | /** |
||
129 | * Gets the selected application. |
||
130 | * |
||
131 | * @return string |
||
132 | */ |
||
133 | 26 | public function getSelectedApplication() : string |
|
137 | |||
138 | /** |
||
139 | * Get the URI path for the selected application. Required for the RouterAdapter to work with directory-based |
||
140 | * applications correctly. |
||
141 | * |
||
142 | * @return string |
||
143 | */ |
||
144 | 18 | public function getSelectedApplicationUri() : string |
|
148 | |||
149 | /** |
||
150 | * Gets the full address |
||
151 | * |
||
152 | * @return string |
||
153 | */ |
||
154 | 3 | public function getAddress() : string |
|
158 | |||
159 | /** |
||
160 | * Gets the request URI |
||
161 | * |
||
162 | * @return string |
||
163 | */ |
||
164 | abstract public function getRequestUri() : string; |
||
165 | |||
166 | /** |
||
167 | * Gets the selected module. |
||
168 | * |
||
169 | * @return string |
||
170 | */ |
||
171 | 18 | public function getSelectedModule() : string |
|
175 | |||
176 | /** |
||
177 | * Gets the selected theme. |
||
178 | * |
||
179 | * @return string |
||
180 | */ |
||
181 | 11 | public function getSelectedTheme() : string |
|
185 | |||
186 | /** |
||
187 | * Gets the resource path for the selected theme. |
||
188 | * |
||
189 | * @return string |
||
190 | */ |
||
191 | 2 | public function getResourcePath() : string |
|
195 | |||
196 | /** |
||
197 | * Gets the request method. |
||
198 | * |
||
199 | * @return string |
||
200 | */ |
||
201 | abstract public function getRequestMethod(): string; |
||
202 | |||
203 | /** |
||
204 | * Gets environment data. |
||
205 | * |
||
206 | * @param string $key |
||
207 | * @return array |
||
208 | */ |
||
209 | abstract public function getEnvironmentData(string $key) : array; |
||
210 | |||
211 | /** |
||
212 | * Gets the client IP address. |
||
213 | * |
||
214 | * @return string |
||
215 | */ |
||
216 | abstract public function getClientIp() : string; |
||
217 | |||
218 | /** |
||
219 | * Gets the execution parameters (CLI). |
||
220 | * |
||
221 | * @return array |
||
222 | */ |
||
223 | 1 | public function getOptions() : array |
|
227 | } |
||
228 |