1 | <?php |
||
36 | class RestlerExtended extends Restler |
||
37 | { |
||
38 | /** |
||
39 | * @var Typo3Cache |
||
40 | */ |
||
41 | private $typo3Cache; |
||
42 | |||
43 | |||
44 | |||
45 | /***************************************************************************************************************************/ |
||
46 | /***************************************************************************************************************************/ |
||
47 | /* Block of methods, which MUST be overriden from parent-class (otherwise we can't use the TYPO3-caching-framework) ********/ |
||
48 | /***************************************************************************************************************************/ |
||
49 | /***************************************************************************************************************************/ |
||
50 | /** |
||
51 | * Constructor |
||
52 | * |
||
53 | * @param Typo3Cache $typo3Cache |
||
54 | * @param boolean $productionMode When set to false, it will run in |
||
55 | * debug mode and parse the class files |
||
56 | * every time to map it to the URL |
||
57 | * |
||
58 | * @param boolean $refreshCache will update the cache when set to true |
||
59 | */ |
||
60 | public function __construct(Typo3Cache $typo3Cache, $productionMode = false, $refreshCache = false) |
||
65 | |||
66 | /** |
||
67 | * Main function for processing the api request |
||
68 | * and return the response |
||
69 | * |
||
70 | * @throws Exception when the api service class is missing |
||
71 | * @throws RestException to send error response |
||
72 | */ |
||
73 | public function handle() |
||
85 | |||
86 | /** |
||
87 | * override postCall so that we can cache response via TYPO3-caching-framework - if it's possible |
||
88 | */ |
||
89 | protected function postCall() |
||
104 | |||
105 | |||
106 | |||
107 | /***************************************************************************************************************************/ |
||
108 | /***************************************************************************************************************************/ |
||
109 | /* Block of methods, which does NOT override logic from parent-class *******************************************************/ |
||
110 | /***************************************************************************************************************************/ |
||
111 | /***************************************************************************************************************************/ |
||
112 | /** |
||
113 | * @return string |
||
114 | */ |
||
115 | private function handleRequestByTypo3Cache() |
||
144 | } |
||
145 |
If you suppress an error, we recommend checking for the error condition explicitly: