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) |
||
82 | |||
83 | /** |
||
84 | * Main function for processing the api request |
||
85 | * and return the response |
||
86 | * |
||
87 | * @throws Exception when the api service class is missing |
||
88 | * @throws RestException to send error response |
||
89 | */ |
||
90 | public function handle() |
||
102 | |||
103 | /** |
||
104 | * override postCall so that we can cache response via TYPO3-caching-framework - if it's possible |
||
105 | */ |
||
106 | protected function postCall() |
||
122 | |||
123 | /** |
||
124 | * Rewrap the not accessible private stream in a new one. |
||
125 | * |
||
126 | * @return bool|resource |
||
127 | */ |
||
128 | public function getRequestStream() |
||
136 | |||
137 | /***************************************************************************************************************************/ |
||
138 | /***************************************************************************************************************************/ |
||
139 | /* Block of methods, which does NOT override logic from parent-class *******************************************************/ |
||
140 | /***************************************************************************************************************************/ |
||
141 | /***************************************************************************************************************************/ |
||
142 | /** |
||
143 | * @return string |
||
144 | */ |
||
145 | private function handleRequestByTypo3Cache() |
||
175 | } |
||
176 |
If you suppress an error, we recommend checking for the error condition explicitly: