API Documentation

Http/Response/Stream.php

Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Http
subpackage
Response
version
$Id: Response.php 17131 2009-07-26 10:03:39Z shahar $
Classes
Zend_Http_Response_Stream

Description

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Zend_Http_Response_Stream

Extends from
Zend_Http_Response
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Http
subpackage
Response
Properties
$stream
$stream_name
$_cleanup
Methods
getStream
setStream
getCleanup
setCleanup
getStreamName
setStreamName
__construct
fromStream
getBody
getRawBody
readStream
__destruct

Description

Zend_Http_Response represents an HTTP 1.0 / 1.1 response message. It includes easy access to all the response's different elemts, as well as some convenience methods for parsing and validating HTTP responses.

Properties

$_cleanup

boolean $_cleanup = ''

Should we clean up the stream file when this response is closed?

Details

$_cleanup
boolean
visibility
protected
default
final
false
static
false

$stream

resource $stream = ''

Response as stream

Details

$stream
resource
visibility
protected
default
final
false
static
false

$stream_name

string $stream_name = ''

The name of the file containing the stream

Will be empty if stream is not file-based.

Details

$stream_name
string
visibility
protected
default
final
false
static
false

Methods

__construct

__construct( int $code, array $headers, string $body = null, string $version = 1.1, string $message = null ) :

HTTP response constructor

In most cases, you would use Zend_Http_Response::fromString to parse an HTTP response string and create a new Zend_Http_Response object.

NOTE: The constructor no longer accepts nulls or empty values for the code and headers and will throw an exception if the passed values do not form a valid HTTP responses.

If no message is passed, the message will be guessed according to the response code.

Arguments
$code
int
Response code (200, 404, ...)
$headers
array
Headers array
$body
string
Response body
$version
string
HTTP version
$message
string
Response code as text
Details
visibility
public
final
false
static
false
throws

__destruct

__destruct( ) :
Details
visibility
public
final
false
static
false

fromStream

fromStream( string $response_str, resource $stream ) : Zend_Http_Response_Stream

Create a new Zend_Http_Response_Stream object from a string

Arguments
$response_str
string
$stream
resource
Details
visibility
public
final
false
static
true

getBody

getBody( ) : string

Get the response body as string

This method returns the body of the HTTP response (the content), as it should be in it's readable version - that is, after decoding it (if it was decoded), deflating it (if it was gzip compressed), etc.

If you want to get the raw body (as transfered on wire) use $this->getRawBody() instead.

Output
string
Details
visibility
public
final
false
static
false

getCleanup

getCleanup( ) : boolean

Get the cleanup trigger

Output
boolean
Details
visibility
public
final
false
static
false

getRawBody

getRawBody( ) : string

Get the raw response body (as transfered "on wire") as string

If the body is encoded (with Transfer-Encoding, not content-encoding - IE "chunked" body), gzip compressed, etc. it will not be decoded.

Output
string
Details
visibility
public
final
false
static
false

getStream

getStream( ) : resourse

Get the response as stream

Output
resourse
Details
visibility
public
final
false
static
false

getStreamName

getStreamName( ) : string

Get file name associated with the stream

Output
string
Details
visibility
public
final
false
static
false

readStream

readStream( ) : string

Read stream content and return it as string

Function reads the remainder of the body from the stream and closes the stream.

Output
string
Details
visibility
protected
final
false
static
false

setCleanup

setCleanup( $cleanup $cleanup = true ) :

Set the cleanup trigger

Arguments
$cleanup
$cleanup
Set cleanup trigger
Details
visibility
public
final
false
static
false

setStream

setStream( resourse $stream ) : Zend_Http_Response_Stream

Set the response stream

Arguments
$stream
resourse
Details
visibility
public
final
false
static
false

setStreamName

setStreamName( string $stream_name ) : Zend_Http_Response_Stream

Set file name associated with the stream

Arguments
$stream_name
string
Name to set
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.