1 | <?php |
||
36 | class RestlerExtended extends Restler |
||
37 | { |
||
38 | /** |
||
39 | * @var Typo3Cache |
||
40 | */ |
||
41 | private $typo3Cache; |
||
42 | |||
43 | /** @var ServerRequestInterface */ |
||
44 | protected $request; |
||
45 | |||
46 | /***************************************************************************************************************************/ |
||
47 | /***************************************************************************************************************************/ |
||
48 | /* Block of methods, which MUST be overriden from parent-class (otherwise we can't use the TYPO3-caching-framework) ********/ |
||
49 | /***************************************************************************************************************************/ |
||
50 | /***************************************************************************************************************************/ |
||
51 | /** |
||
52 | * Constructor |
||
53 | * |
||
54 | * @param Typo3Cache $typo3Cache |
||
55 | * @param bool $productionMode When set to false, it will run in |
||
56 | * debug mode and parse the class files |
||
57 | * every time to map it to the URL |
||
58 | * |
||
59 | * @param bool $refreshCache will update the cache when set to true |
||
60 | * @param ServerRequestInterface frontend request |
||
61 | */ |
||
62 | public function __construct(Typo3Cache $typo3Cache, $productionMode = false, $refreshCache = false, ServerRequestInterface $request = null) |
||
81 | |||
82 | /** |
||
83 | * Main function for processing the api request |
||
84 | * and return the response |
||
85 | * |
||
86 | * @throws Exception when the api service class is missing |
||
87 | * @throws RestException to send error response |
||
88 | */ |
||
89 | public function handle() |
||
101 | |||
102 | /** |
||
103 | * Determine path (and baseUrl) for current request. |
||
104 | * |
||
105 | * @return string|string[]|null |
||
106 | */ |
||
107 | protected function getPath() |
||
127 | |||
128 | /** |
||
129 | * override postCall so that we can cache response via TYPO3-caching-framework - if it's possible |
||
130 | */ |
||
131 | protected function postCall() |
||
147 | |||
148 | /** |
||
149 | * Rewrap the not accessible private stream in a new one. |
||
150 | * |
||
151 | * @return bool|resource |
||
152 | */ |
||
153 | public function getRequestStream() |
||
161 | |||
162 | /***************************************************************************************************************************/ |
||
163 | /***************************************************************************************************************************/ |
||
164 | /* Block of methods, which does NOT override logic from parent-class *******************************************************/ |
||
165 | /***************************************************************************************************************************/ |
||
166 | /***************************************************************************************************************************/ |
||
167 | /** |
||
168 | * @return string |
||
169 | */ |
||
170 | private function handleRequestByTypo3Cache() |
||
200 | } |
||
201 |
If you suppress an error, we recommend checking for the error condition explicitly: