| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | final protected function main() |
||
| 17 | { |
||
| 18 | if (headers_sent()) { |
||
| 19 | throw new ApiException('Headers have already been sent - this indicates a bug in the application!'); |
||
| 20 | } |
||
| 21 | |||
| 22 | try { |
||
| 23 | $responseData = $this->runApiPage(); |
||
| 24 | } |
||
| 25 | catch (ApiException $ex) { |
||
| 26 | $responseData = $ex->getMessage(); |
||
| 27 | } |
||
| 28 | |||
| 29 | header('Content-Type: text/plain'); |
||
| 30 | |||
| 31 | ob_end_clean(); |
||
| 32 | print($responseData); |
||
| 33 | ob_start(); |
||
| 34 | } |
||
| 36 |