Fixes issue #276: Enable Response::sendFile() to operate on resources

This commit is contained in:
Qiang Xue
2013-06-10 16:37:35 -04:00
parent 9806563f7f
commit f14774dfb6
5 changed files with 152 additions and 191 deletions

View File

@@ -7,8 +7,6 @@
namespace yii\base;
use yii\web\Response;
/**
* HttpException represents an exception caused by an improper request of the end-user.
*
@@ -44,8 +42,9 @@ class HttpException extends UserException
*/
public function getName()
{
if (isset(Response::$httpStatuses[$this->statusCode])) {
return Response::$httpStatuses[$this->statusCode];
// 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];
} else {
return 'Error';
}