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
ed11750c
Commit
ed11750c
authored
Jan 03, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1751 from lucianobaraglia/some-debug-fixes
Some debug code style fixes...
parents
239778ef
a1e51146
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
22 deletions
+22
-22
DefaultController.php
extensions/yii/debug/controllers/DefaultController.php
+2
-2
DbPanel.php
extensions/yii/debug/panels/DbPanel.php
+4
-4
LogPanel.php
extensions/yii/debug/panels/LogPanel.php
+4
-4
ProfilingPanel.php
extensions/yii/debug/panels/ProfilingPanel.php
+2
-2
detail.php
extensions/yii/debug/views/default/panels/request/detail.php
+9
-9
view.php
extensions/yii/debug/views/default/view.php
+1
-1
No files found.
extensions/yii/debug/controllers/DefaultController.php
View file @
ed11750c
...
@@ -20,7 +20,7 @@ class DefaultController extends Controller
...
@@ -20,7 +20,7 @@ class DefaultController extends Controller
{
{
public
$layout
=
'main'
;
public
$layout
=
'main'
;
/**
/**
* @var
\yii\debug\Module
* @var \yii\debug\Module
*/
*/
public
$module
;
public
$module
;
/**
/**
...
@@ -88,7 +88,7 @@ class DefaultController extends Controller
...
@@ -88,7 +88,7 @@ class DefaultController extends Controller
protected
function
getManifest
(
$forceReload
=
false
)
protected
function
getManifest
(
$forceReload
=
false
)
{
{
if
(
$this
->
_manifest
===
null
||
$forceReload
)
{
if
(
$this
->
_manifest
===
null
||
$forceReload
)
{
if
(
$forceReload
)
{
if
(
$forceReload
)
{
clearstatcache
();
clearstatcache
();
}
}
$indexFile
=
$this
->
module
->
dataPath
.
'/index.data'
;
$indexFile
=
$this
->
module
->
dataPath
.
'/index.data'
;
...
...
extensions/yii/debug/panels/DbPanel.php
View file @
ed11750c
...
@@ -42,7 +42,7 @@ class DbPanel extends Panel
...
@@ -42,7 +42,7 @@ class DbPanel extends Panel
$queryCount
=
count
(
$timings
);
$queryCount
=
count
(
$timings
);
$queryTime
=
number_format
(
$this
->
getTotalQueryTime
(
$timings
)
*
1000
)
.
' ms'
;
$queryTime
=
number_format
(
$this
->
getTotalQueryTime
(
$timings
)
*
1000
)
.
' ms'
;
return
Yii
::
$app
->
view
->
render
(
'panels/db/summary'
,
[
return
Yii
::
$app
->
view
->
render
(
'panels/db/summary'
,
[
'timings'
=>
$this
->
calculateTimings
(),
'timings'
=>
$this
->
calculateTimings
(),
'panel'
=>
$this
,
'panel'
=>
$this
,
'queryCount'
=>
$queryCount
,
'queryCount'
=>
$queryCount
,
...
@@ -55,7 +55,7 @@ class DbPanel extends Panel
...
@@ -55,7 +55,7 @@ class DbPanel extends Panel
$searchModel
=
new
Db
();
$searchModel
=
new
Db
();
$dataProvider
=
$searchModel
->
search
(
Yii
::
$app
->
request
->
get
(),
$this
->
getModels
());
$dataProvider
=
$searchModel
->
search
(
Yii
::
$app
->
request
->
get
(),
$this
->
getModels
());
return
Yii
::
$app
->
view
->
render
(
'panels/db/detail'
,
[
return
Yii
::
$app
->
view
->
render
(
'panels/db/detail'
,
[
'panel'
=>
$this
,
'panel'
=>
$this
,
'dataProvider'
=>
$dataProvider
,
'dataProvider'
=>
$dataProvider
,
'searchModel'
=>
$searchModel
,
'searchModel'
=>
$searchModel
,
...
@@ -112,9 +112,9 @@ class DbPanel extends Panel
...
@@ -112,9 +112,9 @@ class DbPanel extends Panel
$this
->
_models
[]
=
[
$this
->
_models
[]
=
[
'type'
=>
$this
->
detectQueryType
(
$dbTiming
[
'info'
]),
'type'
=>
$this
->
detectQueryType
(
$dbTiming
[
'info'
]),
'query'
=>
$dbTiming
[
'info'
],
'query'
=>
$dbTiming
[
'info'
],
'duration'
=>
(
$dbTiming
[
'duration'
]
*
1000
),
#
in milliseconds
'duration'
=>
(
$dbTiming
[
'duration'
]
*
1000
),
//
in milliseconds
'trace'
=>
$dbTiming
[
'trace'
],
'trace'
=>
$dbTiming
[
'trace'
],
'timestamp'
=>
$dbTiming
[
'timestamp'
],
'timestamp'
=>
(
$dbTiming
[
'timestamp'
]
*
1000
),
// in milliseconds
'seq'
=>
$seq
,
'seq'
=>
$seq
,
];
];
}
}
...
...
extensions/yii/debug/panels/LogPanel.php
View file @
ed11750c
...
@@ -33,7 +33,7 @@ class LogPanel extends Panel
...
@@ -33,7 +33,7 @@ class LogPanel extends Panel
public
function
getSummary
()
public
function
getSummary
()
{
{
return
Yii
::
$app
->
view
->
render
(
'panels/log/summary'
,
[
'data'
=>
$this
->
data
,
'panel'
=>
$this
]);
return
Yii
::
$app
->
view
->
render
(
'panels/log/summary'
,
[
'data'
=>
$this
->
data
,
'panel'
=>
$this
]);
}
}
public
function
getDetail
()
public
function
getDetail
()
...
@@ -41,7 +41,7 @@ class LogPanel extends Panel
...
@@ -41,7 +41,7 @@ class LogPanel extends Panel
$searchModel
=
new
Log
();
$searchModel
=
new
Log
();
$dataProvider
=
$searchModel
->
search
(
Yii
::
$app
->
request
->
get
(),
$this
->
getModels
());
$dataProvider
=
$searchModel
->
search
(
Yii
::
$app
->
request
->
get
(),
$this
->
getModels
());
return
Yii
::
$app
->
view
->
render
(
'panels/log/detail'
,
[
return
Yii
::
$app
->
view
->
render
(
'panels/log/detail'
,
[
'dataProvider'
=>
$dataProvider
,
'dataProvider'
=>
$dataProvider
,
'panel'
=>
$this
,
'panel'
=>
$this
,
'searchModel'
=>
$searchModel
,
'searchModel'
=>
$searchModel
,
...
@@ -61,7 +61,7 @@ class LogPanel extends Panel
...
@@ -61,7 +61,7 @@ class LogPanel extends Panel
* @param boolean $refresh if needed to build models from log messages and refresh them.
* @param boolean $refresh if needed to build models from log messages and refresh them.
* @return array models
* @return array models
*/
*/
protected
function
getModels
(
$refresh
=
false
)
protected
function
getModels
(
$refresh
=
false
)
{
{
if
(
$this
->
_models
===
null
||
$refresh
)
{
if
(
$this
->
_models
===
null
||
$refresh
)
{
$this
->
_models
=
[];
$this
->
_models
=
[];
...
@@ -71,7 +71,7 @@ class LogPanel extends Panel
...
@@ -71,7 +71,7 @@ class LogPanel extends Panel
'message'
=>
$message
[
0
],
'message'
=>
$message
[
0
],
'level'
=>
$message
[
1
],
'level'
=>
$message
[
1
],
'category'
=>
$message
[
2
],
'category'
=>
$message
[
2
],
'time'
=>
(
$message
[
3
]
*
1000
),
#
time in milliseconds
'time'
=>
(
$message
[
3
]
*
1000
),
//
time in milliseconds
'trace'
=>
$message
[
4
]
'trace'
=>
$message
[
4
]
];
];
}
}
...
...
extensions/yii/debug/panels/ProfilingPanel.php
View file @
ed11750c
...
@@ -32,7 +32,7 @@ class ProfilingPanel extends Panel
...
@@ -32,7 +32,7 @@ class ProfilingPanel extends Panel
public
function
getSummary
()
public
function
getSummary
()
{
{
return
Yii
::
$app
->
view
->
render
(
'panels/profile/summary'
,
[
return
Yii
::
$app
->
view
->
render
(
'panels/profile/summary'
,
[
'memory'
=>
sprintf
(
'%.1f MB'
,
$this
->
data
[
'memory'
]
/
1048576
),
'memory'
=>
sprintf
(
'%.1f MB'
,
$this
->
data
[
'memory'
]
/
1048576
),
'time'
=>
number_format
(
$this
->
data
[
'time'
]
*
1000
)
.
' ms'
,
'time'
=>
number_format
(
$this
->
data
[
'time'
]
*
1000
)
.
' ms'
,
'panel'
=>
$this
'panel'
=>
$this
...
@@ -44,7 +44,7 @@ class ProfilingPanel extends Panel
...
@@ -44,7 +44,7 @@ class ProfilingPanel extends Panel
$searchModel
=
new
Profile
();
$searchModel
=
new
Profile
();
$dataProvider
=
$searchModel
->
search
(
Yii
::
$app
->
request
->
get
(),
$this
->
getModels
());
$dataProvider
=
$searchModel
->
search
(
Yii
::
$app
->
request
->
get
(),
$this
->
getModels
());
return
Yii
::
$app
->
view
->
render
(
'panels/profile/detail'
,
[
return
Yii
::
$app
->
view
->
render
(
'panels/profile/detail'
,
[
'panel'
=>
$this
,
'panel'
=>
$this
,
'dataProvider'
=>
$dataProvider
,
'dataProvider'
=>
$dataProvider
,
'searchModel'
=>
$searchModel
,
'searchModel'
=>
$searchModel
,
...
...
extensions/yii/debug/views/default/panels/request/detail.php
View file @
ed11750c
...
@@ -9,22 +9,22 @@ echo Tabs::widget([
...
@@ -9,22 +9,22 @@ echo Tabs::widget([
'items'
=>
[
'items'
=>
[
[
[
'label'
=>
'Parameters'
,
'label'
=>
'Parameters'
,
'content'
=>
$this
->
render
(
'panels/request/table'
,
[
'caption'
=>
'Routing'
,
'values'
=>
[
'Route'
=>
$panel
->
data
[
'route'
],
'Action'
=>
$panel
->
data
[
'action'
],
'Parameters'
=>
$panel
->
data
[
'actionParams'
]]])
'content'
=>
$this
->
render
(
'panels/request/table'
,
[
'caption'
=>
'Routing'
,
'values'
=>
[
'Route'
=>
$panel
->
data
[
'route'
],
'Action'
=>
$panel
->
data
[
'action'
],
'Parameters'
=>
$panel
->
data
[
'actionParams'
]]])
.
$this
->
render
(
'panels/request/table'
,
[
'caption'
=>
'$_GET'
,
'values'
=>
$panel
->
data
[
'GET'
]])
.
$this
->
render
(
'panels/request/table'
,
[
'caption'
=>
'$_GET'
,
'values'
=>
$panel
->
data
[
'GET'
]])
.
$this
->
render
(
'panels/request/table'
,
[
'caption'
=>
'$_POST'
,
'values'
=>
$panel
->
data
[
'POST'
]])
.
$this
->
render
(
'panels/request/table'
,
[
'caption'
=>
'$_POST'
,
'values'
=>
$panel
->
data
[
'POST'
]])
.
$this
->
render
(
'panels/request/table'
,
[
'caption'
=>
'$_FILES'
,
'values'
=>
$panel
->
data
[
'FILES'
]])
.
$this
->
render
(
'panels/request/table'
,
[
'caption'
=>
'$_FILES'
,
'values'
=>
$panel
->
data
[
'FILES'
]])
.
$this
->
render
(
'panels/request/table'
,
[
'caption'
=>
'$_COOKIE'
,
'values'
=>
$panel
->
data
[
'COOKIE'
]]),
.
$this
->
render
(
'panels/request/table'
,
[
'caption'
=>
'$_COOKIE'
,
'values'
=>
$panel
->
data
[
'COOKIE'
]]),
'active'
=>
true
,
'active'
=>
true
,
],
],
[
[
'label'
=>
'Headers'
,
'label'
=>
'Headers'
,
'content'
=>
$this
->
render
(
'panels/request/table'
,
[
'caption'
=>
'Request Headers'
,
'values'
=>
$panel
->
data
[
'requestHeaders'
]])
'content'
=>
$this
->
render
(
'panels/request/table'
,
[
'caption'
=>
'Request Headers'
,
'values'
=>
$panel
->
data
[
'requestHeaders'
]])
.
$this
->
render
(
'panels/request/table'
,
[
'caption'
=>
'Response Headers'
,
'values'
=>
$panel
->
data
[
'responseHeaders'
]])
.
$this
->
render
(
'panels/request/table'
,
[
'caption'
=>
'Response Headers'
,
'values'
=>
$panel
->
data
[
'responseHeaders'
]])
],
],
[
[
'label'
=>
'Session'
,
'label'
=>
'Session'
,
'content'
=>
$this
->
render
(
'panels/request/table'
,
[
'caption'
=>
'$_SESSION'
,
'values'
=>
$panel
->
data
[
'SESSION'
]])
'content'
=>
$this
->
render
(
'panels/request/table'
,
[
'caption'
=>
'$_SESSION'
,
'values'
=>
$panel
->
data
[
'SESSION'
]])
.
$this
->
render
(
'panels/request/table'
,
[
'caption'
=>
'Flashes'
,
'values'
=>
$panel
->
data
[
'flashes'
]])
.
$this
->
render
(
'panels/request/table'
,
[
'caption'
=>
'Flashes'
,
'values'
=>
$panel
->
data
[
'flashes'
]])
],
],
[
[
'label'
=>
'$_SERVER'
,
'label'
=>
'$_SERVER'
,
...
...
extensions/yii/debug/views/default/view.php
View file @
ed11750c
...
@@ -18,7 +18,7 @@ $this->title = 'Yii Debugger';
...
@@ -18,7 +18,7 @@ $this->title = 'Yii Debugger';
<div
class=
"default-view"
>
<div
class=
"default-view"
>
<div
id=
"yii-debug-toolbar"
>
<div
id=
"yii-debug-toolbar"
>
<div
class=
"yii-debug-toolbar-block title"
>
<div
class=
"yii-debug-toolbar-block title"
>
<?
php
echo
Html
::
a
(
'Yii Debugger'
,
[
'index'
],[
'title'
=>
'Back to main debug page'
]);
?>
<?
=
Html
::
a
(
'Yii Debugger'
,
[
'index'
],
[
'title'
=>
'Back to main debug page'
])
?>
</div>
</div>
<?php
foreach
(
$panels
as
$panel
)
:
?>
<?php
foreach
(
$panels
as
$panel
)
:
?>
<?=
$panel
->
getSummary
()
?>
<?=
$panel
->
getSummary
()
?>
...
...
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