Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
9f4ccb62
Commit
9f4ccb62
authored
Aug 02, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added status code display to debugger toolbar.
parent
da81f8da
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
3 deletions
+19
-3
ProfilingPanel.php
framework/yii/debug/panels/ProfilingPanel.php
+2
-2
RequestPanel.php
framework/yii/debug/panels/RequestPanel.php
+17
-0
Response.php
framework/yii/web/Response.php
+0
-1
No files found.
framework/yii/debug/panels/ProfilingPanel.php
View file @
9f4ccb62
...
@@ -33,10 +33,10 @@ class ProfilingPanel extends Panel
...
@@ -33,10 +33,10 @@ class ProfilingPanel extends Panel
return
<<<EOD
return
<<<EOD
<div class="yii-debug-toolbar-block">
<div class="yii-debug-toolbar-block">
<a href="$url" title="
t
otal processing time">Time: <span class="label">$time</span></a>
<a href="$url" title="
T
otal processing time">Time: <span class="label">$time</span></a>
</div>
</div>
<div class="yii-debug-toolbar-block">
<div class="yii-debug-toolbar-block">
<a href="$url" title="
p
eak memory consumption">Memory: <span class="label">$memory</span></a>
<a href="$url" title="
P
eak memory consumption">Memory: <span class="label">$memory</span></a>
</div>
</div>
EOD;
EOD;
}
}
...
...
framework/yii/debug/panels/RequestPanel.php
View file @
9f4ccb62
...
@@ -12,6 +12,7 @@ use yii\base\InlineAction;
...
@@ -12,6 +12,7 @@ use yii\base\InlineAction;
use
yii\bootstrap\Tabs
;
use
yii\bootstrap\Tabs
;
use
yii\debug\Panel
;
use
yii\debug\Panel
;
use
yii\helpers\Html
;
use
yii\helpers\Html
;
use
yii\web\Response
;
/**
/**
* Debugger panel that collects and displays request data.
* Debugger panel that collects and displays request data.
...
@@ -29,9 +30,24 @@ class RequestPanel extends Panel
...
@@ -29,9 +30,24 @@ class RequestPanel extends Panel
public
function
getSummary
()
public
function
getSummary
()
{
{
$url
=
$this
->
getUrl
();
$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
<<<EOD
return
<<<EOD
<div class="yii-debug-toolbar-block">
<div class="yii-debug-toolbar-block">
<a href="$url" title="Status code: $statusCode $statusText"><span class="label $class">$statusCode</span></a>
</div>
<div class="yii-debug-toolbar-block">
<a href="$url">Action: <span class="label">{$this->data['action']}</span></a>
<a href="$url">Action: <span class="label">{$this->data['action']}</span></a>
</div>
</div>
EOD;
EOD;
...
@@ -113,6 +129,7 @@ EOD;
...
@@ -113,6 +129,7 @@ EOD;
$session
=
Yii
::
$app
->
getComponent
(
'session'
,
false
);
$session
=
Yii
::
$app
->
getComponent
(
'session'
,
false
);
return
array
(
return
array
(
'flashes'
=>
$session
?
$session
->
getAllFlashes
()
:
array
(),
'flashes'
=>
$session
?
$session
->
getAllFlashes
()
:
array
(),
'statusCode'
=>
Yii
::
$app
->
getResponse
()
->
getStatusCode
(),
'requestHeaders'
=>
$requestHeaders
,
'requestHeaders'
=>
$requestHeaders
,
'responseHeaders'
=>
$responseHeaders
,
'responseHeaders'
=>
$responseHeaders
,
'route'
=>
Yii
::
$app
->
requestedAction
?
Yii
::
$app
->
requestedAction
->
getUniqueId
()
:
Yii
::
$app
->
requestedRoute
,
'route'
=>
Yii
::
$app
->
requestedAction
?
Yii
::
$app
->
requestedAction
->
getUniqueId
()
:
Yii
::
$app
->
requestedRoute
,
...
...
framework/yii/web/Response.php
View file @
9f4ccb62
...
@@ -258,7 +258,6 @@ class Response extends \yii\base\Response
...
@@ -258,7 +258,6 @@ class Response extends \yii\base\Response
$this
->
sendHeaders
();
$this
->
sendHeaders
();
$this
->
sendContent
();
$this
->
sendContent
();
$this
->
trigger
(
self
::
EVENT_AFTER_SEND
,
new
ResponseEvent
(
$this
));
$this
->
trigger
(
self
::
EVENT_AFTER_SEND
,
new
ResponseEvent
(
$this
));
$this
->
clear
();
}
}
/**
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment