Controller/Response/Cli.php

Show: PublicProtectedPrivateinherited
Table of Contents
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.

Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Controller  
Version
$Id: Cli.php 24593 2012-01-05 20:35:02Z matthew $  

\Zend_Controller_Response_Cli

Package: Zend\Controller\Response
Zend_Controller_Response_Cli

CLI response for controllers

Parent(s)
\Zend_Controller_Response_Abstract
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Uses
\global\Zend_Controller_Response_Abstract  

Properties

>VPropertyprotectedarray $_body = array()
inherited
Body content
Inherited from: \Zend_Controller_Response_Abstract::$$_body
Default valuearray()Details
Type
array
Inherited_from
\Zend_Controller_Response_Abstract::$$_body  
>VPropertyprotected\Exception $_exceptions = array()
inherited
Exception stack
Inherited from: \Zend_Controller_Response_Abstract::$$_exceptions
Default valuearray()Details
Type
\Exception
Inherited_from
\Zend_Controller_Response_Abstract::$$_exceptions  
>VPropertyprotectedarray $_headers = array()
inherited
Array of headers.
Inherited from: \Zend_Controller_Response_Abstract::$$_headers

Each header is an array with keys 'name' and 'value'

Default valuearray()Details
Type
array
Inherited_from
\Zend_Controller_Response_Abstract::$$_headers  
>VPropertyprotectedarray $_headersRaw = array()
inherited
Array of raw headers.
Inherited from: \Zend_Controller_Response_Abstract::$$_headersRaw

Each header is a single string, the entire header to emit

Default valuearray()Details
Type
array
Inherited_from
\Zend_Controller_Response_Abstract::$$_headersRaw  
>VPropertyprotectedint $_httpResponseCode = 200
inherited
HTTP response code to use in headers
Inherited from: \Zend_Controller_Response_Abstract::$$_httpResponseCode
Default value200Details
Type
int
Inherited_from
\Zend_Controller_Response_Abstract::$$_httpResponseCode  
>VPropertyprotectedboolean $_isRedirect = false
inherited
Flag; is this response a redirect?
Inherited from: \Zend_Controller_Response_Abstract::$$_isRedirect
Default valuefalseDetails
Type
boolean
Inherited_from
\Zend_Controller_Response_Abstract::$$_isRedirect  
>VPropertyprotectedboolean $_renderExceptions = false
inherited
Whether or not to render exceptions; off by default
Inherited from: \Zend_Controller_Response_Abstract::$$_renderExceptions
Default valuefalseDetails
Type
boolean
Inherited_from
\Zend_Controller_Response_Abstract::$$_renderExceptions  
>VPropertypublicboolean $headersSentThrowsException = false
Flag; if true, when header operations are called after headers have been sent, an exception will be raised; otherwise, processing will continue as normal.

Defaults to false.

Default valuefalseDetails
Type
boolean
See
\canSendHeaders()  

Methods

methodpublic__toString() : string

Magic __toString functionality

Proxies to sendResponse() and returns response value as string using output buffering.

Returns
TypeDescription
string
methodprotected_normalizeHeader(string $name) : string
inherited

Normalize a header name

Inherited from: \Zend_Controller_Response_Abstract::_normalizeHeader()

Normalizes a header name to X-Capitalized-Names

Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
string
methodpublicappend(string $name, string $content) : \Zend_Controller_Response_Abstract
inherited

Append a named body segment to the body content array

Inherited from: \Zend_Controller_Response_Abstract::append()

If segment already exists, replaces with $content and places at end of array.

Parameters
NameTypeDescription
$namestring
$contentstring
Returns
TypeDescription
\Zend_Controller_Response_Abstract
methodpublicappendBody(string $content, null | string $name = null) : \Zend_Controller_Response_Abstract
inherited

Append content to the body content

Inherited from: \Zend_Controller_Response_Abstract::appendBody()
Parameters
NameTypeDescription
$contentstring
$namenull | string
Returns
TypeDescription
\Zend_Controller_Response_Abstract
methodpubliccanSendHeaders(boolean $throw = false) : boolean
inherited

Can we send headers?

Inherited from: \Zend_Controller_Response_Abstract::canSendHeaders()
Parameters
NameTypeDescription
$throwboolean

Whether or not to throw an exception if headers have been sent; defaults to false

Returns
TypeDescription
boolean
Throws
ExceptionDescription
\Zend_Controller_Response_Exception
methodpublicclearAllHeaders() : \Zend_Controller_Response_Abstract
inherited

Clear all headers, normal and raw

Inherited from: \Zend_Controller_Response_Abstract::clearAllHeaders()
methodpublicclearBody(string $name = null) : boolean
inherited

Clear body array

Inherited from: \Zend_Controller_Response_Abstract::clearBody()

With no arguments, clears the entire body array. Given a $name, clears just that named segment; if no segment matching $name exists, returns false to indicate an error.

Parameters
NameTypeDescription
$namestring

Named segment to clear

Returns
TypeDescription
boolean
methodpublicclearHeader(string $name) : \Zend_Controller_Response_Abstract
inherited

Clears the specified HTTP header

Inherited from: \Zend_Controller_Response_Abstract::clearHeader()
Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
\Zend_Controller_Response_Abstract
methodpublicclearRawHeader(string $headerRaw) : \Zend_Controller_Response_Abstract
inherited

Clears the specified raw HTTP header

Inherited from: \Zend_Controller_Response_Abstract::clearRawHeader()
Parameters
NameTypeDescription
$headerRawstring
Returns
TypeDescription
\Zend_Controller_Response_Abstract
methodpublicclearRawHeaders() : \Zend_Controller_Response_Abstract
inherited

Clear all {@link setRawHeader() raw HTTP headers}

Inherited from: \Zend_Controller_Response_Abstract::clearRawHeaders()
methodpublicgetBody(boolean $spec = false) : string | array | null
inherited

Return the body content

Inherited from: \Zend_Controller_Response_Abstract::getBody()

If $spec is false, returns the concatenated values of the body content array. If $spec is boolean true, returns the body content array. If $spec is a string and matches a named segment, returns the contents of that segment; otherwise, returns null.

Parameters
NameTypeDescription
$specboolean
Returns
TypeDescription
string | array | null
methodpublicgetException() : array
inherited

Retrieve the exception stack

Inherited from: \Zend_Controller_Response_Abstract::getException()
Returns
TypeDescription
array
methodpublicgetExceptionByCode(mixed $code) : void
inherited

Retrieve all exceptions of a given code

Inherited from: \Zend_Controller_Response_Abstract::getExceptionByCode()
Parameters
NameTypeDescription
$codemixed
methodpublicgetExceptionByMessage(string $message) : false | array
inherited

Retrieve all exceptions of a given message

Inherited from: \Zend_Controller_Response_Abstract::getExceptionByMessage()
Parameters
NameTypeDescription
$messagestring
Returns
TypeDescription
false | array
methodpublicgetExceptionByType(string $type) : false | array
inherited

Retrieve all exceptions of a given type

Inherited from: \Zend_Controller_Response_Abstract::getExceptionByType()
Parameters
NameTypeDescription
$typestring
Returns
TypeDescription
false | array
methodpublicgetHeaders() : array
inherited

Return array of headers; see {@link $_headers} for format

Inherited from: \Zend_Controller_Response_Abstract::getHeaders()
Returns
TypeDescription
array
methodpublicgetHttpResponseCode() : int
inherited

Retrieve HTTP response code

Inherited from: \Zend_Controller_Response_Abstract::getHttpResponseCode()
Returns
TypeDescription
int
methodpublicgetRawHeaders() : array
inherited

Retrieve all {@link setRawHeader() raw HTTP headers}

Inherited from: \Zend_Controller_Response_Abstract::getRawHeaders()
Returns
TypeDescription
array
methodpublichasExceptionOfCode(int $code) : boolean
inherited

Does the response object contain an exception with a given code?

Inherited from: \Zend_Controller_Response_Abstract::hasExceptionOfCode()
Parameters
NameTypeDescription
$codeint
Returns
TypeDescription
boolean
methodpublichasExceptionOfMessage(string $message) : boolean
inherited

Does the response object contain an exception with a given message?

Inherited from: \Zend_Controller_Response_Abstract::hasExceptionOfMessage()
Parameters
NameTypeDescription
$messagestring
Returns
TypeDescription
boolean
methodpublichasExceptionOfType(string $type) : boolean
inherited

Does the response object contain an exception of a given type?

Inherited from: \Zend_Controller_Response_Abstract::hasExceptionOfType()
Parameters
NameTypeDescription
$typestring
Returns
TypeDescription
boolean
methodpublicinsert(string $name, string $content, string $parent = null, boolean $before = false) : \Zend_Controller_Response_Abstract
inherited

Insert a named segment into the body content array

Inherited from: \Zend_Controller_Response_Abstract::insert()
Parameters
NameTypeDescription
$namestring
$contentstring
$parentstring
$beforeboolean

Whether to insert the new segment before or after the parent. Defaults to false (after)

Returns
TypeDescription
\Zend_Controller_Response_Abstract
methodpublicisException() : boolean
inherited

Has an exception been registered with the response?

Inherited from: \Zend_Controller_Response_Abstract::isException()
Returns
TypeDescription
boolean
methodpublicisRedirect() : boolean
inherited

Is this a redirect?

Inherited from: \Zend_Controller_Response_Abstract::isRedirect()
Returns
TypeDescription
boolean
methodpublicoutputBody() : void
inherited

Echo the body segments

Inherited from: \Zend_Controller_Response_Abstract::outputBody()
methodpublicprepend(string $name, string $content) : void
inherited

Prepend a named body segment to the body content array

Inherited from: \Zend_Controller_Response_Abstract::prepend()

If segment already exists, replaces with $content and places at top of array.

Parameters
NameTypeDescription
$namestring
$contentstring
methodpublicrenderExceptions(boolean $flag = null) : boolean
inherited

Whether or not to render exceptions (off by default)

Inherited from: \Zend_Controller_Response_Abstract::renderExceptions()

If called with no arguments or a null argument, returns the value of the flag; otherwise, sets it and returns the current value.

Parameters
NameTypeDescription
$flagboolean

Optional

Returns
TypeDescription
boolean
methodpublicsendHeaders() : \Zend_Controller_Response_Abstract
inherited

Send all headers

Inherited from: \Zend_Controller_Response_Abstract::sendHeaders()

Sends any headers specified. If an HTTP response code has been specified, it is sent with the first header.

Returns
TypeDescription
\Zend_Controller_Response_Abstract
methodpublicsendResponse() : void
inherited

Send the response, including all headers, rendering exceptions if so requested.

Inherited from: \Zend_Controller_Response_Abstract::sendResponse()
methodpublicsetBody(string $content, null | string $name = null) : \Zend_Controller_Response_Abstract
inherited

Set body content

Inherited from: \Zend_Controller_Response_Abstract::setBody()

If $name is not passed, or is not a string, resets the entire body and sets the 'default' key to $content.

If $name is a string, sets the named segment in the body array to $content.

Parameters
NameTypeDescription
$contentstring
$namenull | string
Returns
TypeDescription
\Zend_Controller_Response_Abstract
methodpublicsetException(\Exception $e) : \Zend_Controller_Response_Abstract
inherited

Register an exception with the response

Inherited from: \Zend_Controller_Response_Abstract::setException()
Parameters
NameTypeDescription
$e\Exception
Returns
TypeDescription
\Zend_Controller_Response_Abstract
methodpublicsetHeader(string $name, string $value, boolean $replace = false) : \Zend_Controller_Response_Abstract
inherited

Set a header

Inherited from: \Zend_Controller_Response_Abstract::setHeader()

If $replace is true, replaces any headers already defined with that $name.

Parameters
NameTypeDescription
$namestring
$valuestring
$replaceboolean
Returns
TypeDescription
\Zend_Controller_Response_Abstract
methodpublicsetHttpResponseCode(int $code) : \Zend_Controller_Response_Abstract
inherited

Set HTTP response code to use with headers

Inherited from: \Zend_Controller_Response_Abstract::setHttpResponseCode()
Parameters
NameTypeDescription
$codeint
Returns
TypeDescription
\Zend_Controller_Response_Abstract
methodpublicsetRawHeader(string $value) : \Zend_Controller_Response_Abstract
inherited

Set raw HTTP header

Inherited from: \Zend_Controller_Response_Abstract::setRawHeader()

Allows setting non key => value headers, such as status codes

Parameters
NameTypeDescription
$valuestring
Returns
TypeDescription
\Zend_Controller_Response_Abstract
methodpublicsetRedirect(string $url, int $code = 302) : \Zend_Controller_Response_Abstract
inherited

Set redirect URL

Inherited from: \Zend_Controller_Response_Abstract::setRedirect()

Sets Location header and response code. Forces replacement of any prior redirects.

Parameters
NameTypeDescription
$urlstring
$codeint
Returns
TypeDescription
\Zend_Controller_Response_Abstract
Documentation was generated by phpDocumentor 2.0.0a12.