1: <?php
2: /**
3: * Copyright 2007-2012 Horde LLC (http://www.horde.org/)
4: *
5: * @author Chuck Hagenbuch <chuck@horde.org>
6: * @license http://www.horde.org/licenses/bsd BSD
7: * @category Horde
8: * @package Http
9: */
10:
11: /**
12: * @author Chuck Hagenbuch <chuck@horde.org>
13: * @license http://www.horde.org/licenses/bsd BSD
14: * @category Horde
15: * @package Http
16: */
17: class Horde_Http_Response_Peclhttp extends Horde_Http_Response_Base
18: {
19: /**
20: * HttpMessage object.
21: *
22: * @var HttpMessage
23: */
24: protected $_message;
25:
26: /**
27: * Constructor.
28: *
29: * @param string $uri
30: * @param HttpMessage $message
31: */
32: public function __construct($uri, HttpMessage $message)
33: {
34: $this->uri = $uri;
35: $this->httpVersion = $message->getHttpVersion();
36: $this->code = $message->getResponseCode();
37: $this->_message = $message;
38: foreach ($message->getHeaders() as $k => $v) {
39: $this->headers[strtolower($k)] = $v;
40: }
41: }
42:
43: public function getBody()
44: {
45: return $this->_message->getBody();
46: }
47: }
48: