Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RequestHandler] added the Request Handler component
- Loading branch information
Showing
9 changed files
with
1,360 additions
and
0 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
src/Symfony/Components/RequestHandler/Exception/ForbiddenHttpException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace Symfony\Components\RequestHandler\Exception; | ||
|
||
class ForbiddenHttpException extends HttpException | ||
{ | ||
public function __construct($message = '') | ||
{ | ||
if (!$message) | ||
{ | ||
$message = 'Forbidden'; | ||
} | ||
|
||
parent::__construct($message, 403); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/Symfony/Components/RequestHandler/Exception/HttpException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
namespace Symfony\Components\RequestHandler\Exception; | ||
|
||
// by convention, exception code == response status code | ||
class HttpException extends \Exception | ||
{ | ||
} |
16 changes: 16 additions & 0 deletions
16
src/Symfony/Components/RequestHandler/Exception/NotFoundHttpException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace Symfony\Components\RequestHandler\Exception; | ||
|
||
class NotFoundHttpException extends HttpException | ||
{ | ||
public function __construct($message = '') | ||
{ | ||
if (!$message) | ||
{ | ||
$message = 'Not Found'; | ||
} | ||
|
||
parent::__construct($message, 404); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/Symfony/Components/RequestHandler/Exception/UnauthorizedHttpException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace Symfony\Components\RequestHandler\Exception; | ||
|
||
class UnauthorizedHttpException extends HttpException | ||
{ | ||
public function __construct($message = '') | ||
{ | ||
if (!$message) | ||
{ | ||
$message = 'Unauthorized'; | ||
} | ||
|
||
parent::__construct($message, 401); | ||
} | ||
} |
Oops, something went wrong.