UrlNormalizerRedirectException.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. /**
  9. * UrlNormalizerRedirectException represents an information for redirection which should be
  10. * performed during the URL normalization.
  11. *
  12. * @author Robert Korulczyk <robert@korulczyk.pl>
  13. * @since 2.0.10
  14. */
  15. class UrlNormalizerRedirectException extends \yii\base\Exception
  16. {
  17. /**
  18. * @var array|string the parameter to be used to generate a valid URL for redirection
  19. * @see [[\yii\helpers\Url::to()]]
  20. */
  21. public $url;
  22. /**
  23. * @var bool|string the URI scheme to use in the generated URL for redirection
  24. * @see [[\yii\helpers\Url::to()]]
  25. */
  26. public $scheme;
  27. /**
  28. * @var int the HTTP status code
  29. */
  30. public $statusCode;
  31. /**
  32. * @param array|string $url the parameter to be used to generate a valid URL for redirection.
  33. * This will be used as first parameter for [[\yii\helpers\Url::to()]]
  34. * @param int $statusCode HTTP status code used for redirection
  35. * @param bool|string $scheme the URI scheme to use in the generated URL for redirection.
  36. * This will be used as second parameter for [[\yii\helpers\Url::to()]]
  37. * @param string $message the error message
  38. * @param int $code the error code
  39. * @param \Exception $previous the previous exception used for the exception chaining
  40. */
  41. public function __construct($url, $statusCode = 302, $scheme = false, $message = null, $code = 0, \Exception $previous = null)
  42. {
  43. $this->url = $url;
  44. $this->scheme = $scheme;
  45. $this->statusCode = $statusCode;
  46. parent::__construct($message, $code, $previous);
  47. }
  48. }