2
0

Cli.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Controller
  17. * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
  18. * @license http://framework.zend.com/license/new-bsd New BSD License
  19. */
  20. /** Zend_Controller_Response_Abstract */
  21. require_once 'Zend/Controller/Response/Abstract.php';
  22. /**
  23. * Zend_Controller_Response_Cli
  24. *
  25. * CLI response for controllers
  26. *
  27. * @uses Zend_Controller_Response_Abstract
  28. * @package Zend_Controller
  29. * @subpackage Response
  30. * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
  31. * @license http://framework.zend.com/license/new-bsd New BSD License
  32. */
  33. class Zend_Controller_Response_Cli extends Zend_Controller_Response_Abstract
  34. {
  35. /**
  36. * Flag; if true, when header operations are called after headers have been
  37. * sent, an exception will be raised; otherwise, processing will continue
  38. * as normal. Defaults to false.
  39. *
  40. * @see canSendHeaders()
  41. * @var boolean
  42. */
  43. public $headersSentThrowsException = false;
  44. /**
  45. * Magic __toString functionality
  46. *
  47. * @return string
  48. */
  49. public function __toString()
  50. {
  51. if ($this->isException() && $this->renderExceptions()) {
  52. $exceptions = '';
  53. foreach ($this->getException() as $e) {
  54. $exceptions .= $e->__toString() . "\n";
  55. }
  56. return $exceptions;
  57. }
  58. return $this->_body;
  59. }
  60. }