1 | <?php |
||
47 | class RestApiRequest extends Restler |
||
48 | { |
||
49 | /** |
||
50 | * store data from $_GET in this property |
||
51 | * |
||
52 | * Attention: |
||
53 | * This property must be static, because it can happen, that some REST-API-calls |
||
54 | * will be called recursive, so we MUST store the 'really original' data |
||
55 | * |
||
56 | * @var array |
||
57 | */ |
||
58 | private static $originalGetVars; |
||
59 | /** |
||
60 | * store data from $_POST in this property |
||
61 | * |
||
62 | * Attention: |
||
63 | * This property must be static, because it can happen, that some REST-API-calls |
||
64 | * will be called recursive, so we MUST store the 'really original' data |
||
65 | * |
||
66 | * @var array |
||
67 | */ |
||
68 | private static $originalPostVars; |
||
69 | /** |
||
70 | * store data from $_SERVER in this property |
||
71 | * |
||
72 | * Attention: |
||
73 | * This property must be static, because it can happen, that some REST-API-calls |
||
74 | * will be called recursive, so we MUST store the 'really original' data |
||
75 | * |
||
76 | * @var array |
||
77 | */ |
||
78 | private static $originalServerSettings; |
||
79 | |||
80 | /** |
||
81 | * @var array |
||
82 | */ |
||
83 | private $restApiGetData; |
||
84 | /** |
||
85 | * @var array |
||
86 | */ |
||
87 | private $restApiPostData; |
||
88 | /** |
||
89 | * This property defines the request-uri (without GET-params, e.g. '/api/products/320'), which should be called |
||
90 | * |
||
91 | * @var string |
||
92 | */ |
||
93 | private $restApiRequestUri; |
||
94 | /** |
||
95 | * This property defines the request-method (e.g. 'GET', 'POST', 'PUT' or 'DELETE'), which should be used while calling the rest-api |
||
96 | * |
||
97 | * @var string |
||
98 | */ |
||
99 | private $restApiRequestMethod; |
||
100 | /** |
||
101 | * @var RestApiRequestScope |
||
102 | */ |
||
103 | private $restApiRequestScope; |
||
104 | /** |
||
105 | * @var Typo3Cache |
||
106 | */ |
||
107 | private $typo3Cache; |
||
108 | |||
109 | |||
110 | |||
111 | /***************************************************************************************************************************/ |
||
112 | /***************************************************************************************************************************/ |
||
113 | /* Block of methods, which does NOT override logic from parent-class *******************************************************/ |
||
114 | /***************************************************************************************************************************/ |
||
115 | /***************************************************************************************************************************/ |
||
116 | /** |
||
117 | * @param string $requestMethod |
||
118 | * @param string $requestUri |
||
119 | * @param array|stdClass $getData |
||
120 | * @param array|stdClass $postData |
||
121 | * @return mixed can be a primitive or array or object |
||
122 | * @throws RestException |
||
123 | */ |
||
124 | 6 | public function executeRestApiRequest($requestMethod, $requestUri, $getData = null, $postData = null) |
|
146 | |||
147 | /** |
||
148 | * Return class, which can decode a JSON-string into a stdClass-object (instead of an array) |
||
149 | * |
||
150 | * @return RestApiJsonFormat |
||
151 | */ |
||
152 | protected function getRestApiJsonFormat() |
||
157 | |||
158 | /** |
||
159 | * @param array|stdClass $data |
||
160 | * @return array |
||
161 | * @throws RestException |
||
162 | */ |
||
163 | 6 | private function convertDataToArray($data) |
|
176 | |||
177 | /** |
||
178 | * @return string |
||
179 | */ |
||
180 | private function handleRequestByTypo3Cache() |
||
193 | |||
194 | /** |
||
195 | * Override (the stored) data of $_GET, $_POST and $_SERVER (which are used in several restler-PHP-classes) and the original |
||
196 | * REST-API-Request-object, because this data/object 'defines' the REST-API-request, which we want to call |
||
197 | * |
||
198 | * @return void |
||
199 | */ |
||
200 | 6 | private function overrideOriginalRestApiRequest() |
|
216 | |||
217 | /** |
||
218 | * Restore (the overridden) data of $_GET, $_POST and $_SERVER and the original REST-API-request-object |
||
219 | * @return void |
||
220 | */ |
||
221 | 6 | private function restoreOriginalRestApiRequest() |
|
229 | |||
230 | /** |
||
231 | * Store (the original) data of $_GET, $_POST and $_SERVER and the original REST-API-request-object |
||
232 | * @return void |
||
233 | */ |
||
234 | 6 | private function storeOriginalRestApiRequest() |
|
244 | |||
245 | |||
246 | |||
247 | /***************************************************************************************************************************/ |
||
248 | /***************************************************************************************************************************/ |
||
249 | /* Block of methods, which MUST be overriden from parent-class (otherwise this class can not work) *************************/ |
||
250 | /***************************************************************************************************************************/ |
||
251 | /***************************************************************************************************************************/ |
||
252 | /** |
||
253 | * Override parent method...because we don't want to call it! |
||
254 | * The original method would set some properties (e.g. set this object into static properties of global classes) |
||
255 | * |
||
256 | * @param RestApiRequestScope $restApiRequestScope |
||
257 | * @param Typo3Cache $typo3Cache |
||
258 | */ |
||
259 | 6 | public function __construct(RestApiRequestScope $restApiRequestScope, Typo3Cache $typo3Cache) |
|
264 | |||
265 | /** |
||
266 | * Override parent method...because we don't want to call it (the original method would cache the determined routes)! |
||
267 | */ |
||
268 | 6 | public function __destruct() |
|
271 | |||
272 | /** |
||
273 | * Override parent method...because we don't want to call it (the original method would send some headers to the client)! |
||
274 | */ |
||
275 | public function composeHeaders(RestException $e = null) |
||
278 | |||
279 | /** |
||
280 | * Override parent method...because we must return the request-data of THIS REST-API request! |
||
281 | * The original method would return the request-data of the ORIGINAL called REST-API request |
||
282 | * |
||
283 | * @param boolean $includeQueryParameters |
||
284 | * @return array |
||
285 | */ |
||
286 | public function getRequestData($includeQueryParameters = true) |
||
298 | |||
299 | /** |
||
300 | * Override parent method...because we must return the data of the REST-API request and we need NO exception-handling! |
||
301 | * |
||
302 | * @return mixed can be a primitive or array or object |
||
303 | */ |
||
304 | public function handle() |
||
334 | |||
335 | /** |
||
336 | * override postCall so that we can cache response via TYPO3-caching-framework - if it's possible |
||
337 | */ |
||
338 | protected function postCall() |
||
353 | } |
||
354 |
Scrutinizer analyzes your
composer.json
/composer.lock
file if available to determine the classes, and functions that are defined by your dependencies.It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.