diff --git a/framework/yii/debug/panels/ProfilingPanel.php b/framework/yii/debug/panels/ProfilingPanel.php index 5bd32ee..b614611 100644 --- a/framework/yii/debug/panels/ProfilingPanel.php +++ b/framework/yii/debug/panels/ProfilingPanel.php @@ -33,10 +33,10 @@ class ProfilingPanel extends Panel return << - Time: $time + Time: $time
- Memory: $memory + Memory: $memory
EOD; } diff --git a/framework/yii/debug/panels/RequestPanel.php b/framework/yii/debug/panels/RequestPanel.php index e709de6..e655f2d 100644 --- a/framework/yii/debug/panels/RequestPanel.php +++ b/framework/yii/debug/panels/RequestPanel.php @@ -12,6 +12,7 @@ use yii\base\InlineAction; use yii\bootstrap\Tabs; use yii\debug\Panel; use yii\helpers\Html; +use yii\web\Response; /** * Debugger panel that collects and displays request data. @@ -29,9 +30,24 @@ class RequestPanel extends Panel public function getSummary() { $url = $this->getUrl(); + $statusCode = $this->data['statusCode']; + if ($statusCode === null) { + $statusCode = 200; + } + if ($statusCode >= 200 && $statusCode < 300) { + $class = 'label-success'; + } elseif ($statusCode >= 100 && $statusCode < 200) { + $class = 'label-info'; + } else { + $class = 'label-important'; + } + $statusText = Html::encode(isset(Response::$httpStatuses[$statusCode]) ? Response::$httpStatuses[$statusCode] : ''); return << + $statusCode + + EOD; @@ -113,6 +129,7 @@ EOD; $session = Yii::$app->getComponent('session', false); return array( 'flashes' => $session ? $session->getAllFlashes() : array(), + 'statusCode' => Yii::$app->getResponse()->getStatusCode(), 'requestHeaders' => $requestHeaders, 'responseHeaders' => $responseHeaders, 'route' => Yii::$app->requestedAction ? Yii::$app->requestedAction->getUniqueId() : Yii::$app->requestedRoute, diff --git a/framework/yii/web/Response.php b/framework/yii/web/Response.php index 5371122..6bb888c 100644 --- a/framework/yii/web/Response.php +++ b/framework/yii/web/Response.php @@ -258,7 +258,6 @@ class Response extends \yii\base\Response $this->sendHeaders(); $this->sendContent(); $this->trigger(self::EVENT_AFTER_SEND, new ResponseEvent($this)); - $this->clear(); } /**