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 $mainDomain; |
||
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 | 1 | public function getApplicationRoot(): string |
|
97 | |||
98 | /** |
||
99 | * Gets the application domain. |
||
100 | * |
||
101 | * @return string |
||
102 | */ |
||
103 | 9 | public function getApplicationDomain() : string |
|
107 | |||
108 | /** |
||
109 | * Gets the application SSL status. |
||
110 | * |
||
111 | * @return bool |
||
112 | */ |
||
113 | 10 | public function isSecuredApplication() : bool |
|
117 | |||
118 | /** |
||
119 | * Gets the selected application. |
||
120 | * |
||
121 | * @return string |
||
122 | */ |
||
123 | 17 | public function getSelectedApplication() : string |
|
127 | |||
128 | /** |
||
129 | * Get the URI path for the selected application. Required for the RouterAdapter to work with directory-based |
||
130 | * applications correctly. |
||
131 | * |
||
132 | * @return string |
||
133 | */ |
||
134 | 17 | public function getSelectedApplicationUri() : string |
|
138 | |||
139 | /** |
||
140 | * Gets the request URI |
||
141 | * |
||
142 | * @return string |
||
143 | */ |
||
144 | abstract public function getRequestUri() : string; |
||
145 | |||
146 | /** |
||
147 | * Gets the selected module. |
||
148 | * |
||
149 | * @return string |
||
150 | */ |
||
151 | 17 | public function getSelectedModule() : string |
|
155 | |||
156 | /** |
||
157 | * Gets the selected theme. |
||
158 | * |
||
159 | * @return string |
||
160 | */ |
||
161 | 11 | public function getSelectedTheme() : string |
|
165 | |||
166 | /** |
||
167 | * Gets the resource path for the selected theme. |
||
168 | * |
||
169 | * @return string |
||
170 | */ |
||
171 | 2 | public function getResourcePath() : string |
|
175 | |||
176 | /** |
||
177 | * Gets the request method. |
||
178 | * |
||
179 | * @return string |
||
180 | */ |
||
181 | abstract public function getRequestMethod(): string; |
||
182 | |||
183 | /** |
||
184 | * Gets environment data. |
||
185 | * |
||
186 | * @param string $key |
||
187 | * @return array |
||
188 | */ |
||
189 | abstract public function getEnvironmentData(string $key) : array; |
||
190 | |||
191 | /** |
||
192 | * Gets the client IP address. |
||
193 | * |
||
194 | * @return string |
||
195 | */ |
||
196 | abstract public function getClientIp() : string; |
||
197 | |||
198 | /** |
||
199 | * Gets the execution parameters (CLI). |
||
200 | * |
||
201 | * @return array |
||
202 | */ |
||
203 | 1 | public function getOptions() : array |
|
207 | } |
||
208 |