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_Response
9: {
10: protected $_headers = array();
11: protected $_body;
12: protected $_requestConfiguration;
13:
14: public function __construct()
15: {
16: }
17:
18: public function setHeaders(array $headers)
19: {
20: $this->_headers = array_merge($this->_headers, $headers);
21: }
22:
23: public function setHeader($name, $value)
24: {
25: $this->_headers[$name] = $value;
26: }
27:
28: public function setContentType($contentType, $charset = 'UTF-8')
29: {
30: $this->setHeader('Content-Type', "$contentType; charset=$charset");
31: }
32:
33: public function setBody($body)
34: {
35: $this->_body = $body;
36: }
37:
38: public function getHeaders()
39: {
40: return $this->_headers;
41: }
42:
43: public function getBody()
44: {
45: return $this->_body;
46: }
47:
48: public function internalRedirect()
49: {
50: return $this->_requestConfiguration != null;
51: }
52:
53: public function setRedirectUrl($url)
54: {
55: $this->_headers['Location'] = $url;
56: }
57:
58: public function getRedirectConfiguration()
59: {
60: return $this->_requestConfiguration;
61: }
62:
63: public function setRedirectConfiguration(Horde_Controller_RequestConfiguration $config)
64: {
65: $this->_requestConfiguration = $config;
66: }
67: }
68: