Response.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * @link http://www.yiiframework.com/
  4. * @copyright Copyright (c) 2008 Yii Software LLC
  5. * @license http://www.yiiframework.com/license/
  6. */
  7. namespace yii\base;
  8. /**
  9. * Response represents the response of an [[Application]] to a [[Request]].
  10. *
  11. * For more details and usage information on Response, see the [guide article on responses](guide:runtime-responses).
  12. *
  13. * @author Qiang Xue <qiang.xue@gmail.com>
  14. * @since 2.0
  15. */
  16. class Response extends Component
  17. {
  18. /**
  19. * @var int the exit status. Exit statuses should be in the range 0 to 254.
  20. * The status 0 means the program terminates successfully.
  21. */
  22. public $exitStatus = 0;
  23. /**
  24. * Sends the response to client.
  25. */
  26. public function send()
  27. {
  28. }
  29. /**
  30. * Removes all existing output buffers.
  31. */
  32. public function clearOutputBuffers()
  33. {
  34. // the following manual level counting is to deal with zlib.output_compression set to On
  35. for ($level = ob_get_level(); $level > 0; --$level) {
  36. if (!@ob_end_clean()) {
  37. ob_clean();
  38. }
  39. }
  40. }
  41. }