1 | <?php |
||
41 | class RestlerExtended extends Restler |
||
42 | { |
||
43 | /** |
||
44 | * @var Typo3Cache |
||
45 | */ |
||
46 | private $typo3Cache; |
||
47 | |||
48 | |||
49 | /** @var ServerRequestInterface */ |
||
50 | protected $request; |
||
51 | |||
52 | /***************************************************************************************************************************/ |
||
53 | /***************************************************************************************************************************/ |
||
54 | /* Block of methods, which MUST be overriden from parent-class (otherwise we can't use the TYPO3-caching-framework) ********/ |
||
55 | /***************************************************************************************************************************/ |
||
56 | /***************************************************************************************************************************/ |
||
57 | /** |
||
58 | * Constructor |
||
59 | * |
||
60 | * @param Typo3Cache $typo3Cache |
||
61 | * @param boolean $productionMode When set to false, it will run in |
||
62 | * debug mode and parse the class files |
||
63 | * every time to map it to the URL |
||
64 | * |
||
65 | * @param boolean $refreshCache will update the cache when set to true |
||
66 | * @param ServerRequestInterface frontend request |
||
67 | */ |
||
68 | public function __construct(Typo3Cache $typo3Cache, $productionMode = false, $refreshCache = false, ServerRequestInterface $request = null) |
||
87 | |||
88 | /** |
||
89 | * Main function for processing the api request |
||
90 | * and return the response |
||
91 | * |
||
92 | * @throws Exception when the api service class is missing |
||
93 | * @throws RestException to send error response |
||
94 | */ |
||
95 | public function handle() |
||
107 | |||
108 | /** |
||
109 | * Determine path (and baseUrl) for current request. |
||
110 | * |
||
111 | * @return string|string[]|null |
||
112 | */ |
||
113 | protected function getPath() |
||
129 | |||
130 | /** |
||
131 | * override postCall so that we can cache response via TYPO3-caching-framework - if it's possible |
||
132 | */ |
||
133 | protected function postCall() |
||
149 | |||
150 | /** |
||
151 | * Rewrap the not accessible private stream in a new one. |
||
152 | * |
||
153 | * @return bool|resource |
||
154 | */ |
||
155 | public function getRequestStream() |
||
163 | |||
164 | /***************************************************************************************************************************/ |
||
165 | /***************************************************************************************************************************/ |
||
166 | /* Block of methods, which does NOT override logic from parent-class *******************************************************/ |
||
167 | /***************************************************************************************************************************/ |
||
168 | /***************************************************************************************************************************/ |
||
169 | /** |
||
170 | * @return string |
||
171 | */ |
||
172 | private function handleRequestByTypo3Cache() |
||
202 | } |
||
203 |
If you suppress an error, we recommend checking for the error condition explicitly: