/usr/share/php/Horde/Http/Response/Fopen.php is in php-horde-http 2.1.1-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | <?php
/**
* Copyright 2007-2014 Horde LLC (http://www.horde.org/)
*
* @author Chuck Hagenbuch <chuck@horde.org>
* @license http://www.horde.org/licenses/bsd BSD
* @category Horde
* @package Http
*/
/**
* @author Chuck Hagenbuch <chuck@horde.org>
* @license http://www.horde.org/licenses/bsd BSD
* @category Horde
* @package Http
*/
class Horde_Http_Response_Fopen extends Horde_Http_Response_Base
{
/**
* Response body.
*
* @var stream
*/
protected $_stream;
/**
* Response content
*/
protected $_content;
/**
* Constructor.
*/
public function __construct($uri, $stream, $headers = array())
{
$this->uri = $uri;
$this->_stream = $stream;
$this->_parseHeaders($headers);
}
/**
* Returns the body of the HTTP response.
*
* @throws Horde_Http_Exception
* @return string HTTP response body.
*/
public function getBody()
{
if (is_null($this->_content)) {
$oldTrackErrors = ini_set('track_errors', 1);
$content = @stream_get_contents($this->_stream);
ini_set('track_errors', $oldTrackErrors);
if ($content === false) {
$msg = 'Problem reading data from ' . $this->uri;
if (isset($php_errormsg)) {
$msg .= ': ' . $php_errormsg;
}
throw new Horde_Http_Exception($msg);
}
$this->_content = $content;
}
return $this->_content;
}
/**
* Returns a stream pointing to the response body that can be used with
* all standard PHP stream functions.
*/
public function getStream()
{
return $this->_stream;
}
}
|