aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/exception/http_exception.php
diff options
context:
space:
mode:
authoralf007 <alf007@free.fr>2015-05-25 00:14:48 +0200
committeralf007 <alf007@free.fr>2015-05-25 00:14:48 +0200
commit6025c40cab2d768c3cad3586fa1bfbfa6c9eeb3b (patch)
treebd40622b18c3ce4d8174f2dc717ae19a12cf3d1a /phpBB/phpbb/exception/http_exception.php
parent6a4cb42565d7e1663da4d02cd8d624b034b20afe (diff)
parent6322970766bd9fa78327fa2ca6a6a43d73b680ee (diff)
downloadforums-6025c40cab2d768c3cad3586fa1bfbfa6c9eeb3b.tar
forums-6025c40cab2d768c3cad3586fa1bfbfa6c9eeb3b.tar.gz
forums-6025c40cab2d768c3cad3586fa1bfbfa6c9eeb3b.tar.bz2
forums-6025c40cab2d768c3cad3586fa1bfbfa6c9eeb3b.tar.xz
forums-6025c40cab2d768c3cad3586fa1bfbfa6c9eeb3b.zip
Merge pull request #1 from phpbb/develop-ascraeus
Develop ascraeus
Diffstat (limited to 'phpBB/phpbb/exception/http_exception.php')
-rw-r--r--phpBB/phpbb/exception/http_exception.php70
1 files changed, 70 insertions, 0 deletions
diff --git a/phpBB/phpbb/exception/http_exception.php b/phpBB/phpbb/exception/http_exception.php
new file mode 100644
index 0000000000..0e6ffe4f59
--- /dev/null
+++ b/phpBB/phpbb/exception/http_exception.php
@@ -0,0 +1,70 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\exception;
+
+use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
+
+/**
+ * Class http_exception
+ */
+class http_exception extends runtime_exception implements HttpExceptionInterface
+{
+ /**
+ * Http status code.
+ *
+ * @var integer
+ */
+ private $status_code;
+
+ /**
+ * Additional headers to set in the response.
+ *
+ * @var array
+ */
+ private $headers;
+
+ /**
+ * Constructor
+ *
+ * @param integer $status_code The http status code.
+ * @param string $message The Exception message to throw (must be a language variable).
+ * @param array $parameters The parameters to use with the language var.
+ * @param \Exception $previous The previous exception used for the exception chaining.
+ * @param array $headers Additional headers to set in the response.
+ * @param integer $code The Exception code.
+ */
+ public function __construct($status_code, $message = "", array $parameters = array(), \Exception $previous = null, array $headers = array(), $code = 0)
+ {
+ $this->status_code = $status_code;
+ $this->headers = $headers;
+
+ parent::__construct($message, $parameters, $previous, $code);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getStatusCode()
+ {
+ return $this->status_code;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getHeaders()
+ {
+ return $this->headers;
+ }
+}