diff --git a/framework/yii/base/Application.php b/framework/yii/base/Application.php
index 8a96e94..9969ecd 100644
--- a/framework/yii/base/Application.php
+++ b/framework/yii/base/Application.php
@@ -8,6 +8,7 @@
namespace yii\base;
use Yii;
+use yii\web\HttpException;
/**
* Application is the base class for all application classes.
diff --git a/framework/yii/base/ErrorHandler.php b/framework/yii/base/ErrorHandler.php
index 4e3e92a..fe9eef3 100644
--- a/framework/yii/base/ErrorHandler.php
+++ b/framework/yii/base/ErrorHandler.php
@@ -8,6 +8,7 @@
namespace yii\base;
use Yii;
+use yii\web\HttpException;
/**
* ErrorHandler handles uncaught PHP errors and exceptions.
diff --git a/framework/yii/views/errorHandler/main.php b/framework/yii/views/errorHandler/main.php
index d7bbb3d..05e217e 100644
--- a/framework/yii/views/errorHandler/main.php
+++ b/framework/yii/views/errorHandler/main.php
@@ -14,7 +14,7 @@ $context = $this->context;
statusCode . ' ' . $context->htmlEncode($exception->getName());
} elseif ($exception instanceof \yii\base\Exception) {
echo $context->htmlEncode($exception->getName() . ' – ' . get_class($exception));
@@ -362,7 +362,7 @@ pre .diff .change{
' . $context->createHttpStatusLink($exception->statusCode, $context->htmlEncode($exception->getName())) . '';
echo ' – ' . $context->addTypeLinks(get_class($exception));
} elseif ($exception instanceof \yii\base\Exception) {
diff --git a/framework/yii/web/AccessControl.php b/framework/yii/web/AccessControl.php
index ce64533..7dedaf9 100644
--- a/framework/yii/web/AccessControl.php
+++ b/framework/yii/web/AccessControl.php
@@ -10,7 +10,7 @@ namespace yii\web;
use Yii;
use yii\base\Action;
use yii\base\ActionFilter;
-use yii\base\HttpException;
+use yii\web\HttpException;
/**
* AccessControl provides simple access control based on a set of rules.
diff --git a/framework/yii/web/Application.php b/framework/yii/web/Application.php
index 12c9295..ce326a2 100644
--- a/framework/yii/web/Application.php
+++ b/framework/yii/web/Application.php
@@ -8,7 +8,7 @@
namespace yii\web;
use Yii;
-use yii\base\HttpException;
+use yii\web\HttpException;
use yii\base\InvalidRouteException;
/**
diff --git a/framework/yii/web/Controller.php b/framework/yii/web/Controller.php
index 026c078..22a2ebd 100644
--- a/framework/yii/web/Controller.php
+++ b/framework/yii/web/Controller.php
@@ -8,7 +8,7 @@
namespace yii\web;
use Yii;
-use yii\base\HttpException;
+use yii\web\HttpException;
use yii\base\InlineAction;
/**
diff --git a/framework/yii/base/HttpException.php b/framework/yii/web/HttpException.php
similarity index 83%
rename from framework/yii/base/HttpException.php
rename to framework/yii/web/HttpException.php
index 2e3c8d4..384a5b4 100644
--- a/framework/yii/base/HttpException.php
+++ b/framework/yii/web/HttpException.php
@@ -5,7 +5,10 @@
* @license http://www.yiiframework.com/license/
*/
-namespace yii\base;
+namespace yii\web;
+
+use yii\base\UserException;
+use yii\web\Response;
/**
* HttpException represents an exception caused by an improper request of the end-user.
@@ -42,9 +45,8 @@ class HttpException extends UserException
*/
public function getName()
{
- // use absolute namespaced class here because PHP will generate a mysterious error otherwise
- if (isset(\yii\web\Response::$httpStatuses[$this->statusCode])) {
- return \yii\web\Response::$httpStatuses[$this->statusCode];
+ if (isset(Response::$httpStatuses[$this->statusCode])) {
+ return Response::$httpStatuses[$this->statusCode];
} else {
return 'Error';
}
diff --git a/framework/yii/web/Request.php b/framework/yii/web/Request.php
index 6f5cdb5..afd2f8a 100644
--- a/framework/yii/web/Request.php
+++ b/framework/yii/web/Request.php
@@ -8,7 +8,7 @@
namespace yii\web;
use Yii;
-use yii\base\HttpException;
+use yii\web\HttpException;
use yii\base\InvalidConfigException;
use yii\helpers\SecurityHelper;
diff --git a/framework/yii/web/Response.php b/framework/yii/web/Response.php
index d74ef2c..ac1c9cc 100644
--- a/framework/yii/web/Response.php
+++ b/framework/yii/web/Response.php
@@ -8,7 +8,7 @@
namespace yii\web;
use Yii;
-use yii\base\HttpException;
+use yii\web\HttpException;
use yii\base\InvalidParamException;
use yii\helpers\FileHelper;
use yii\helpers\Html;
diff --git a/framework/yii/web/User.php b/framework/yii/web/User.php
index 7ea561c..f273c1a 100644
--- a/framework/yii/web/User.php
+++ b/framework/yii/web/User.php
@@ -9,7 +9,7 @@ namespace yii\web;
use Yii;
use yii\base\Component;
-use yii\base\HttpException;
+use yii\web\HttpException;
use yii\base\InvalidConfigException;
/**
diff --git a/framework/yii/web/VerbFilter.php b/framework/yii/web/VerbFilter.php
index 2b7567f..a3fd662 100644
--- a/framework/yii/web/VerbFilter.php
+++ b/framework/yii/web/VerbFilter.php
@@ -10,7 +10,7 @@ namespace yii\web;
use Yii;
use yii\base\ActionEvent;
use yii\base\Behavior;
-use yii\base\HttpException;
+use yii\web\HttpException;
/**
* VerbFilter is an action filter that filters by HTTP request methods.
@@ -70,7 +70,7 @@ class VerbFilter extends Behavior
/**
* @param ActionEvent $event
* @return boolean
- * @throws \yii\base\HttpException when the request method is not allowed.
+ * @throws HttpException when the request method is not allowed.
*/
public function beforeAction($event)
{
diff --git a/tests/unit/framework/web/ResponseTest.php b/tests/unit/framework/web/ResponseTest.php
index d87546f..f35dda4 100644
--- a/tests/unit/framework/web/ResponseTest.php
+++ b/tests/unit/framework/web/ResponseTest.php
@@ -76,7 +76,7 @@ class ResponseTest extends \yiiunit\TestCase
*/
public function testSendFileWrongRanges($rangeHeader)
{
- $this->setExpectedException('yii\base\HttpException');
+ $this->setExpectedException('yii\web\HttpException');
$dataFile = \Yii::getAlias('@yiiunit/data/web/data.txt');
$_SERVER['HTTP_RANGE'] = 'bytes=' . $rangeHeader;