1: <?php
2: /**
3: * @category Horde
4: * @package Controller
5: * @author James Pepin <james@bluestatedigital.com>
6: * @license http://www.horde.org/licenses/bsd BSD
7: */
8: class Horde_Controller_ResponseWriter_Web implements Horde_Controller_ResponseWriter
9: {
10: /**
11: */
12: public function writeResponse(Horde_Controller_Response $response)
13: {
14: foreach ($response->getHeaders() as $key => $value) {
15: header("$key: $value");
16: }
17: $body = $response->getBody();
18: if (is_resource($body)) {
19: stream_copy_to_stream($body, fopen('php://output', 'a'));
20: } else {
21: echo $body;
22: }
23: }
24: }
25: