File indexing completed on 2024-12-22 05:36:33
0001 <?php 0002 /** 0003 * Zend Framework 0004 * 0005 * LICENSE 0006 * 0007 * This source file is subject to the new BSD license that is bundled 0008 * with this package in the file LICENSE.txt. 0009 * It is also available through the world-wide-web at this URL: 0010 * http://framework.zend.com/license/new-bsd 0011 * If you did not receive a copy of the license and are unable to 0012 * obtain it through the world-wide-web, please send an email 0013 * to license@zend.com so we can send you a copy immediately. 0014 * 0015 * @category Zend 0016 * @package Zend_Controller 0017 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0018 * @license http://framework.zend.com/license/new-bsd New BSD License 0019 * @version $Id$ 0020 */ 0021 0022 0023 /** Zend_Controller_Response_Abstract */ 0024 // require_once 'Zend/Controller/Response/Abstract.php'; 0025 0026 0027 /** 0028 * Zend_Controller_Response_Cli 0029 * 0030 * CLI response for controllers 0031 * 0032 * @uses Zend_Controller_Response_Abstract 0033 * @package Zend_Controller 0034 * @subpackage Response 0035 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0036 * @license http://framework.zend.com/license/new-bsd New BSD License 0037 */ 0038 class Zend_Controller_Response_Cli extends Zend_Controller_Response_Abstract 0039 { 0040 /** 0041 * Flag; if true, when header operations are called after headers have been 0042 * sent, an exception will be raised; otherwise, processing will continue 0043 * as normal. Defaults to false. 0044 * 0045 * @see canSendHeaders() 0046 * @var boolean 0047 */ 0048 public $headersSentThrowsException = false; 0049 0050 0051 /** 0052 * Magic __toString functionality 0053 * 0054 * @return string 0055 */ 0056 public function __toString() 0057 { 0058 if ($this->isException() && $this->renderExceptions()) { 0059 $exceptions = ''; 0060 foreach ($this->getException() as $e) { 0061 $exceptions .= $e->__toString() . "\n"; 0062 } 0063 return $exceptions; 0064 } 0065 0066 return $this->_body; 0067 } 0068 }