| Conditions | 4 |
| Paths | 4 |
| Total Lines | 24 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 34 | public function sendResponse() |
||
| 35 | { |
||
| 36 | // Check to see if headers have already been sent out, in which case we can't do our job |
||
| 37 | if(headers_sent($sFilename, $nLineNumber)) |
||
| 38 | { |
||
| 39 | throw new RequestException($this->xTranslator->trans('errors.output.already-sent', |
||
| 40 | ['location' => $sFilename . ':' . $nLineNumber]) . "\n" . |
||
| 41 | $this->xTranslator->trans('errors.output.advice')); |
||
| 42 | } |
||
| 43 | if(empty($sContent = $this->xResponseManager->getOutput())) |
||
| 44 | { |
||
| 45 | return; |
||
| 46 | } |
||
| 47 | |||
| 48 | if($this->di()->getRequest()->getMethod() === 'GET') |
||
| 49 | { |
||
| 50 | header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); |
||
| 51 | header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); |
||
| 52 | header("Cache-Control: no-cache, must-revalidate"); |
||
| 53 | header("Pragma: no-cache"); |
||
| 54 | } |
||
| 55 | header('content-type: ' . $this->xResponseManager->getContentType()); |
||
| 56 | |||
| 57 | print $sContent; |
||
| 58 | } |
||
| 60 |