HeadersAlreadySentException.php 700 B

123456789101112131415161718192021222324252627282930
  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\web;
  8. use yii\base\Exception;
  9. /**
  10. * HeadersAlreadySentException represents an exception caused by
  11. * any headers that were already sent before web response was sent.
  12. *
  13. * @author Dmitry Dorogin <dmirogin@ya.ru>
  14. * @since 2.0.14
  15. */
  16. class HeadersAlreadySentException extends Exception
  17. {
  18. /**
  19. * {@inheritdoc}
  20. */
  21. public function __construct($file, $line)
  22. {
  23. $message = YII_DEBUG ? "Headers already sent in {$file} on line {$line}." : 'Headers already sent.';
  24. parent::__construct($message);
  25. }
  26. }