[ Index ]

PHP Cross Reference of phpBB-3.1.12-deutsch

title

Body

[close]

/phpbb/exception/ -> http_exception.php (source)

   1  <?php
   2  /**
   3  *
   4  * This file is part of the phpBB Forum Software package.
   5  *
   6  * @copyright (c) phpBB Limited <https://www.phpbb.com>
   7  * @license GNU General Public License, version 2 (GPL-2.0)
   8  *
   9  * For full copyright and license information, please see
  10  * the docs/CREDITS.txt file.
  11  *
  12  */
  13  
  14  namespace phpbb\exception;
  15  
  16  use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
  17  
  18  /**
  19   * Class http_exception
  20   */
  21  class http_exception extends runtime_exception implements HttpExceptionInterface
  22  {
  23      /**
  24       * Http status code.
  25       *
  26       * @var integer
  27       */
  28      private $status_code;
  29  
  30      /**
  31       * Additional headers to set in the response.
  32       *
  33       * @var array
  34       */
  35      private $headers;
  36  
  37      /**
  38       * Constructor
  39       *
  40       * @param integer        $status_code    The http status code.
  41       * @param string        $message        The Exception message to throw (must be a language variable).
  42       * @param array            $parameters        The parameters to use with the language var.
  43       * @param \Exception    $previous        The previous exception used for the exception chaining.
  44       * @param array            $headers        Additional headers to set in the response.
  45       * @param integer        $code            The Exception code.
  46       */
  47  	public function __construct($status_code, $message = "", array $parameters = array(), \Exception $previous = null, array $headers = array(), $code = 0)
  48      {
  49          $this->status_code = $status_code;
  50          $this->headers = $headers;
  51  
  52          parent::__construct($message, $parameters, $previous, $code);
  53      }
  54  
  55      /**
  56       * {@inheritdoc}
  57       */
  58  	public function getStatusCode()
  59      {
  60          return $this->status_code;
  61      }
  62  
  63      /**
  64       * {@inheritdoc}
  65       */
  66  	public function getHeaders()
  67      {
  68          return $this->headers;
  69      }
  70  }


Generated: Thu Jan 11 00:25:41 2018 Cross-referenced by PHPXref 0.7.1