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
dc9f9d92
Commit
dc9f9d92
authored
Jun 11, 2014
by
Klimov Paul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Doc comments and code style for 'debug' extension adjusted
parent
bd574e8b
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
150 additions
and
65 deletions
+150
-65
Panel.php
extensions/debug/Panel.php
+10
-0
MailPanel.php
extensions/debug/panels/MailPanel.php
+15
-1
index.php
extensions/debug/views/default/index.php
+4
-5
table.php
extensions/debug/views/default/panels/config/table.php
+1
-1
detail.php
extensions/debug/views/default/panels/db/detail.php
+6
-0
summary.php
extensions/debug/views/default/panels/db/summary.php
+7
-0
detail.php
extensions/debug/views/default/panels/log/detail.php
+6
-0
summary.php
extensions/debug/views/default/panels/log/summary.php
+5
-0
_item.php
extensions/debug/views/default/panels/mail/_item.php
+31
-28
detail.php
extensions/debug/views/default/panels/mail/detail.php
+21
-15
summary.php
extensions/debug/views/default/panels/mail/summary.php
+1
-0
detail.php
extensions/debug/views/default/panels/profile/detail.php
+8
-0
summary.php
extensions/debug/views/default/panels/profile/summary.php
+7
-0
detail.php
extensions/debug/views/default/panels/request/detail.php
+2
-2
summary.php
extensions/debug/views/default/panels/request/summary.php
+3
-3
table.php
extensions/debug/views/default/panels/request/table.php
+3
-3
toolbar.php
extensions/debug/views/default/toolbar.php
+1
-0
view.php
extensions/debug/views/default/view.php
+5
-6
DebugAction.php
extensions/elasticsearch/DebugAction.php
+5
-1
DebugPanel.php
extensions/elasticsearch/DebugPanel.php
+9
-0
No files found.
extensions/debug/Panel.php
View file @
dc9f9d92
...
@@ -25,12 +25,22 @@ use yii\helpers\Url;
...
@@ -25,12 +25,22 @@ use yii\helpers\Url;
*/
*/
class
Panel
extends
Component
class
Panel
extends
Component
{
{
/**
* @var string panel unique identifier.
* It is set automatically by the container module.
*/
public
$id
;
public
$id
;
/**
* @var string request data set identifier.
*/
public
$tag
;
public
$tag
;
/**
/**
* @var Module
* @var Module
*/
*/
public
$module
;
public
$module
;
/**
* @var mixed data associated with panel
*/
public
$data
;
public
$data
;
/**
/**
* @var array array of actions to add to the debug modules default controller.
* @var array array of actions to add to the debug modules default controller.
...
...
extensions/debug/panels/MailPanel.php
View file @
dc9f9d92
...
@@ -25,7 +25,6 @@ use yii\mail\MessageInterface;
...
@@ -25,7 +25,6 @@ use yii\mail\MessageInterface;
*/
*/
class
MailPanel
extends
Panel
class
MailPanel
extends
Panel
{
{
/**
/**
* @var string path where all emails will be saved. should be an alias.
* @var string path where all emails will be saved. should be an alias.
*/
*/
...
@@ -35,6 +34,9 @@ class MailPanel extends Panel
...
@@ -35,6 +34,9 @@ class MailPanel extends Panel
*/
*/
private
$_messages
=
[];
private
$_messages
=
[];
/**
* @inheritdoc
*/
public
function
init
()
public
function
init
()
{
{
parent
::
init
();
parent
::
init
();
...
@@ -74,16 +76,25 @@ class MailPanel extends Panel
...
@@ -74,16 +76,25 @@ class MailPanel extends Panel
});
});
}
}
/**
* @inheritdoc
*/
public
function
getName
()
public
function
getName
()
{
{
return
'Mail'
;
return
'Mail'
;
}
}
/**
* @inheritdoc
*/
public
function
getSummary
()
public
function
getSummary
()
{
{
return
Yii
::
$app
->
view
->
render
(
'panels/mail/summary'
,
[
'panel'
=>
$this
,
'mailCount'
=>
count
(
$this
->
data
)]);
return
Yii
::
$app
->
view
->
render
(
'panels/mail/summary'
,
[
'panel'
=>
$this
,
'mailCount'
=>
count
(
$this
->
data
)]);
}
}
/**
* @inheritdoc
*/
public
function
getDetail
()
public
function
getDetail
()
{
{
$searchModel
=
new
Mail
();
$searchModel
=
new
Mail
();
...
@@ -96,6 +107,9 @@ class MailPanel extends Panel
...
@@ -96,6 +107,9 @@ class MailPanel extends Panel
]);
]);
}
}
/**
* @inheritdoc
*/
public
function
save
()
public
function
save
()
{
{
return
$this
->
getMessages
();
return
$this
->
getMessages
();
...
...
extensions/debug/views/default/index.php
View file @
dc9f9d92
<?php
<?php
use
yii\helpers\Html
;
use
yii\grid\GridView
;
use
yii\data\ArrayDataProvider
;
/**
/**
* @var \yii\web\View $this
* @var \yii\web\View $this
* @var array $manifest
* @var array $manifest
...
@@ -12,6 +7,10 @@ use yii\data\ArrayDataProvider;
...
@@ -12,6 +7,10 @@ use yii\data\ArrayDataProvider;
* @var \yii\debug\Panel[] $panels
* @var \yii\debug\Panel[] $panels
*/
*/
use
yii\helpers\Html
;
use
yii\grid\GridView
;
use
yii\data\ArrayDataProvider
;
$this
->
title
=
'Yii Debugger'
;
$this
->
title
=
'Yii Debugger'
;
?>
?>
<div
class=
"default-index"
>
<div
class=
"default-index"
>
...
...
extensions/debug/views/default/panels/config/table.php
View file @
dc9f9d92
...
@@ -13,7 +13,7 @@ use yii\helpers\Html;
...
@@ -13,7 +13,7 @@ use yii\helpers\Html;
<p>
Empty.
</p>
<p>
Empty.
</p>
<?php
else
:
?>
<?php
else
:
?>
<table
class=
"table table-condensed table-bordered table-striped table-hover"
style=
"table-layout: fixed;"
>
<table
class=
"table table-condensed table-bordered table-striped table-hover"
style=
"table-layout: fixed;"
>
<thead>
<thead>
...
...
extensions/debug/views/default/panels/db/detail.php
View file @
dc9f9d92
<?php
<?php
/**
* @var yii\debug\panels\DbPanel $panel
* @var yii\debug\models\search\Db $searchModel
* @var yii\data\ArrayDataProvider $dataProvider
*/
use
yii\helpers\Html
;
use
yii\helpers\Html
;
use
yii\grid\GridView
;
use
yii\grid\GridView
;
...
...
extensions/debug/views/default/panels/db/summary.php
View file @
dc9f9d92
<?php
/**
* @var yii\debug\panels\DbPanel $panel
* @var integer $queryCount
* @var integer $queryTime
*/
?>
<?php
if
(
$queryCount
)
:
?>
<?php
if
(
$queryCount
)
:
?>
<div
class=
"yii-debug-toolbar-block"
>
<div
class=
"yii-debug-toolbar-block"
>
<a
href=
"
<?=
$panel
->
getUrl
()
?>
"
title=
"Executed
<?=
$queryCount
?>
database queries which took
<?=
$queryTime
?>
."
>
<a
href=
"
<?=
$panel
->
getUrl
()
?>
"
title=
"Executed
<?=
$queryCount
?>
database queries which took
<?=
$queryTime
?>
."
>
...
...
extensions/debug/views/default/panels/log/detail.php
View file @
dc9f9d92
<?php
<?php
/**
* @var yii\debug\panels\LogPanel $panel
* @var yii\debug\models\search\Log $searchModel
* @var yii\data\ArrayDataProvider $dataProvider
*/
use
yii\helpers\Html
;
use
yii\helpers\Html
;
use
yii\grid\GridView
;
use
yii\grid\GridView
;
use
yii\helpers\VarDumper
;
use
yii\helpers\VarDumper
;
...
...
extensions/debug/views/default/panels/log/summary.php
View file @
dc9f9d92
<?php
<?php
/**
* @var yii\debug\panels\LogPanel $panel
* @var array $data
*/
use
yii\log\Target
;
use
yii\log\Target
;
use
yii\log\Logger
;
use
yii\log\Logger
;
...
...
extensions/debug/views/default/panels/mail/_item.php
View file @
dc9f9d92
<?php
<?php
/**
* @var array $model
*/
use
yii\helpers\Html
;
use
yii\helpers\Html
;
use
yii\widgets\DetailView
;
use
yii\widgets\DetailView
;
...
@@ -6,33 +9,33 @@ use yii\widgets\DetailView;
...
@@ -6,33 +9,33 @@ use yii\widgets\DetailView;
$timeFormatter
=
extension_loaded
(
'intl'
)
?
Yii
::
createObject
([
'class'
=>
'yii\i18n\Formatter'
])
:
Yii
::
$app
->
formatter
;
$timeFormatter
=
extension_loaded
(
'intl'
)
?
Yii
::
createObject
([
'class'
=>
'yii\i18n\Formatter'
])
:
Yii
::
$app
->
formatter
;
echo
DetailView
::
widget
([
echo
DetailView
::
widget
([
'model'
=>
$model
,
'model'
=>
$model
,
'attributes'
=>
[
'attributes'
=>
[
'headers'
,
'headers'
,
'from'
,
'from'
,
'to'
,
'to'
,
'charset'
,
'charset'
,
[
[
'attribute'
=>
'time'
,
'attribute'
=>
'time'
,
'value'
=>
$timeFormatter
->
asDateTime
(
$model
[
'time'
],
'short'
),
'value'
=>
$timeFormatter
->
asDateTime
(
$model
[
'time'
],
'short'
),
],
'subject'
,
[
'attribute'
=>
'body'
,
'label'
=>
'Text body'
,
],
[
'attribute'
=>
'isSuccessful'
,
'label'
=>
'Successfully sent'
,
'value'
=>
$model
[
'isSuccessful'
]
?
'Yes'
:
'No'
],
'reply'
,
'bcc'
,
'cc'
,
[
'attribute'
=>
'file'
,
'format'
=>
'html'
,
'value'
=>
Html
::
a
(
'Download eml'
,
[
'download-mail'
,
'file'
=>
$model
[
'file'
]]),
],
],
],
'subject'
,
[
'attribute'
=>
'body'
,
'label'
=>
'Text body'
,
],
[
'attribute'
=>
'isSuccessful'
,
'label'
=>
'Successfully sent'
,
'value'
=>
$model
[
'isSuccessful'
]
?
'Yes'
:
'No'
],
'reply'
,
'bcc'
,
'cc'
,
[
'attribute'
=>
'file'
,
'format'
=>
'html'
,
'value'
=>
Html
::
a
(
'Download eml'
,
[
'download-mail'
,
'file'
=>
$model
[
'file'
]]),
],
],
]);
]);
extensions/debug/views/default/panels/mail/detail.php
View file @
dc9f9d92
<?php
<?php
/**
* @var yii\debug\panels\MailPanel $panel
* @var yii\debug\models\search\Mail $searchModel
* @var yii\data\ArrayDataProvider $dataProvider
*/
use
\yii\widgets\ListView
;
use
\yii\widgets\ListView
;
use
yii\widgets\ActiveForm
;
use
yii\widgets\ActiveForm
;
use
yii\helpers\Html
;
use
yii\helpers\Html
;
$listView
=
new
ListView
([
$listView
=
new
ListView
([
'dataProvider'
=>
$dataProvider
,
'dataProvider'
=>
$dataProvider
,
'itemView'
=>
'_item'
,
'itemView'
=>
'_item'
,
'layout'
=>
"
{
summary}\n{items}\n{pager
}
\n
"
,
'layout'
=>
"
{
summary}\n{items}\n{pager
}
\n
"
,
]);
]);
$listView
->
sorter
=
[
'options'
=>
[
'class'
=>
'mail-sorter'
]];
$listView
->
sorter
=
[
'options'
=>
[
'class'
=>
'mail-sorter'
]];
?>
?>
<h1>
Email messages
</h1>
<h1>
Email messages
</h1>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-lg-2"
>
<div
class=
"col-lg-2"
>
<?=
Html
::
button
(
'Form filtering'
,
[
'class'
=>
'btn btn-default'
,
'onclick'
=>
'$("#email-form").toggle();'
])
?>
<?=
Html
::
button
(
'Form filtering'
,
[
'class'
=>
'btn btn-default'
,
'onclick'
=>
'$("#email-form").toggle();'
])
?>
</div>
</div>
<div
class=
"row col-lg-10"
>
<div
class=
"row col-lg-10"
>
<?=
$listView
->
renderSorter
()
?>
<?=
$listView
->
renderSorter
()
?>
...
@@ -25,24 +31,24 @@ $listView->sorter = ['options' => ['class'=>'mail-sorter']];
...
@@ -25,24 +31,24 @@ $listView->sorter = ['options' => ['class'=>'mail-sorter']];
<div
id=
"email-form"
style=
"display: none;"
>
<div
id=
"email-form"
style=
"display: none;"
>
<?php
$form
=
ActiveForm
::
begin
([
<?php
$form
=
ActiveForm
::
begin
([
'method'
=>
'get'
,
'method'
=>
'get'
,
'action'
=>
[
'/debug/default/view'
,
'tag'
=>
\Yii
::
$app
->
request
->
get
(
'tag'
),
'panel'
=>
'mail'
],
'action'
=>
[
'/debug/default/view'
,
'tag'
=>
Yii
::
$app
->
request
->
get
(
'tag'
),
'panel'
=>
'mail'
],
]);
?>
]);
?>
<div
class=
"row"
>
<div
class=
"row"
>
<?=
$form
->
field
(
$searchModel
,
'from'
,
[
'options'
=>
[
'class'
=>
'col-lg-6'
]])
->
textInput
()
?>
<?=
$form
->
field
(
$searchModel
,
'from'
,
[
'options'
=>
[
'class'
=>
'col-lg-6'
]])
->
textInput
()
?>
<?=
$form
->
field
(
$searchModel
,
'to'
,
[
'options'
=>
[
'class'
=>
'col-lg-6'
]])
->
textInput
()
?>
<?=
$form
->
field
(
$searchModel
,
'to'
,
[
'options'
=>
[
'class'
=>
'col-lg-6'
]])
->
textInput
()
?>
<?=
$form
->
field
(
$searchModel
,
'reply'
,
[
'options'
=>
[
'class'
=>
'col-lg-6'
]])
->
textInput
()
?>
<?=
$form
->
field
(
$searchModel
,
'reply'
,
[
'options'
=>
[
'class'
=>
'col-lg-6'
]])
->
textInput
()
?>
<?=
$form
->
field
(
$searchModel
,
'cc'
,
[
'options'
=>
[
'class'
=>
'col-lg-6'
]])
->
textInput
()
?>
<?=
$form
->
field
(
$searchModel
,
'cc'
,
[
'options'
=>
[
'class'
=>
'col-lg-6'
]])
->
textInput
()
?>
<?=
$form
->
field
(
$searchModel
,
'bcc'
,
[
'options'
=>
[
'class'
=>
'col-lg-6'
]])
->
textInput
()
?>
<?=
$form
->
field
(
$searchModel
,
'bcc'
,
[
'options'
=>
[
'class'
=>
'col-lg-6'
]])
->
textInput
()
?>
<?=
$form
->
field
(
$searchModel
,
'charset'
,
[
'options'
=>
[
'class'
=>
'col-lg-6'
]])
->
textInput
()
?>
<?=
$form
->
field
(
$searchModel
,
'charset'
,
[
'options'
=>
[
'class'
=>
'col-lg-6'
]])
->
textInput
()
?>
<?=
$form
->
field
(
$searchModel
,
'subject'
,
[
'options'
=>
[
'class'
=>
'col-lg-6'
]])
->
textInput
()
?>
<?=
$form
->
field
(
$searchModel
,
'subject'
,
[
'options'
=>
[
'class'
=>
'col-lg-6'
]])
->
textInput
()
?>
<?=
$form
->
field
(
$searchModel
,
'body'
,
[
'options'
=>
[
'class'
=>
'col-lg-6'
]])
->
textInput
()
?>
<?=
$form
->
field
(
$searchModel
,
'body'
,
[
'options'
=>
[
'class'
=>
'col-lg-6'
]])
->
textInput
()
?>
<div
class=
"form-group col-lg-12"
>
<div
class=
"form-group col-lg-12"
>
<?=
Html
::
submitButton
(
'Filter'
,
[
'class'
=>
'btn btn-success'
])
?>
<?=
Html
::
submitButton
(
'Filter'
,
[
'class'
=>
'btn btn-success'
])
?>
...
...
extensions/debug/views/default/panels/mail/summary.php
View file @
dc9f9d92
<?php
<?php
/**
/**
* @var yii\debug\panels\MailPanel $panel
* @var yii\debug\panels\MailPanel $panel
* @var integer $mailCount
*/
*/
if
(
$mailCount
)
:
?>
if
(
$mailCount
)
:
?>
<div
class=
"yii-debug-toolbar-block"
>
<div
class=
"yii-debug-toolbar-block"
>
...
...
extensions/debug/views/default/panels/profile/detail.php
View file @
dc9f9d92
<?php
<?php
/**
* @var yii\debug\panels\ProfilingPanel $panel
* @var yii\debug\models\search\Profile $searchModel
* @var yii\data\ArrayDataProvider $dataProvider
* @var integer $time
* @var integer $memory
*/
use
yii\grid\GridView
;
use
yii\grid\GridView
;
use
yii\helpers\Html
;
use
yii\helpers\Html
;
...
...
extensions/debug/views/default/panels/profile/summary.php
View file @
dc9f9d92
<?php
/**
* @var yii\debug\panels\ProfilingPanel $panel
* @var integer $time
* @var integer $memory
*/
?>
<div
class=
"yii-debug-toolbar-block"
>
<div
class=
"yii-debug-toolbar-block"
>
<a
href=
"
<?=
$panel
->
getUrl
()
?>
"
title=
"Total request processing time was
<?=
$time
?>
"
>
Time
<span
class=
"label label-info"
>
<?=
$time
?>
</span></a>
<a
href=
"
<?=
$panel
->
getUrl
()
?>
"
title=
"Total request processing time was
<?=
$time
?>
"
>
Time
<span
class=
"label label-info"
>
<?=
$time
?>
</span></a>
<a
href=
"
<?=
$panel
->
getUrl
()
?>
"
title=
"Peak memory consumption"
>
Memory
<span
class=
"label label-info"
>
<?=
$memory
?>
</span></a>
<a
href=
"
<?=
$panel
->
getUrl
()
?>
"
title=
"Peak memory consumption"
>
Memory
<span
class=
"label label-info"
>
<?=
$memory
?>
</span></a>
...
...
extensions/debug/views/default/panels/request/detail.php
View file @
dc9f9d92
<?php
<?php
use
yii\bootstrap\Tabs
;
/**
/**
* @var yii\debug\panels\RequestPanel $panel
* @var yii\debug\panels\RequestPanel $panel
*/
*/
use
yii\bootstrap\Tabs
;
echo
"<h1>Request</h1>"
;
echo
"<h1>Request</h1>"
;
echo
Tabs
::
widget
([
echo
Tabs
::
widget
([
...
...
extensions/debug/views/default/panels/request/summary.php
View file @
dc9f9d92
<?php
<?php
use
yii\helpers\Html
;
use
yii\web\Response
;
/**
/**
* @var yii\debug\panels\RequestPanel $panel
* @var yii\debug\panels\RequestPanel $panel
*/
*/
use
yii\helpers\Html
;
use
yii\web\Response
;
$statusCode
=
$panel
->
data
[
'statusCode'
];
$statusCode
=
$panel
->
data
[
'statusCode'
];
if
(
$statusCode
===
null
)
{
if
(
$statusCode
===
null
)
{
$statusCode
=
200
;
$statusCode
=
200
;
...
...
extensions/debug/views/default/panels/request/table.php
View file @
dc9f9d92
<?php
<?php
use
yii\helpers\Html
;
use
yii\helpers\VarDumper
;
/**
/**
* @var string $caption
* @var string $caption
* @var array $values
* @var array $values
*/
*/
use
yii\helpers\Html
;
use
yii\helpers\VarDumper
;
?>
?>
<h3>
<?=
$caption
?>
</h3>
<h3>
<?=
$caption
?>
</h3>
...
...
extensions/debug/views/default/toolbar.php
View file @
dc9f9d92
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
* @var string $tag
* @var string $tag
* @var string $position
* @var string $position
*/
*/
use
yii\helpers\Url
;
use
yii\helpers\Url
;
$minJs
=
<<<EOD
$minJs
=
<<<EOD
...
...
extensions/debug/views/default/view.php
View file @
dc9f9d92
<?php
<?php
use
yii\bootstrap\ButtonDropdown
;
use
yii\bootstrap\ButtonGroup
;
use
yii\helpers\Url
;
use
yii\helpers\Html
;
/**
/**
* @var \yii\web\View $this
* @var \yii\web\View $this
* @var array $summary
* @var array $summary
...
@@ -14,6 +8,11 @@ use yii\helpers\Html;
...
@@ -14,6 +8,11 @@ use yii\helpers\Html;
* @var \yii\debug\Panel $activePanel
* @var \yii\debug\Panel $activePanel
*/
*/
use
yii\bootstrap\ButtonDropdown
;
use
yii\bootstrap\ButtonGroup
;
use
yii\helpers\Url
;
use
yii\helpers\Html
;
$this
->
title
=
'Yii Debugger'
;
$this
->
title
=
'Yii Debugger'
;
?>
?>
<div
class=
"default-view"
>
<div
class=
"default-view"
>
...
...
extensions/elasticsearch/DebugAction.php
View file @
dc9f9d92
...
@@ -28,9 +28,13 @@ class DebugAction extends Action
...
@@ -28,9 +28,13 @@ class DebugAction extends Action
*/
*/
public
$db
;
public
$db
;
/**
/**
* @var Panel
* @var
Debug
Panel
*/
*/
public
$panel
;
public
$panel
;
/**
* @var \yii\debug\controllers\DefaultController
*/
public
$controller
;
public
function
run
(
$logId
,
$tag
)
public
function
run
(
$logId
,
$tag
)
{
{
...
...
extensions/elasticsearch/DebugPanel.php
View file @
dc9f9d92
...
@@ -33,11 +33,17 @@ class DebugPanel extends Panel
...
@@ -33,11 +33,17 @@ class DebugPanel extends Panel
];
];
}
}
/**
* @inheritdoc
*/
public
function
getName
()
public
function
getName
()
{
{
return
'Elasticsearch'
;
return
'Elasticsearch'
;
}
}
/**
* @inheritdoc
*/
public
function
getSummary
()
public
function
getSummary
()
{
{
$timings
=
$this
->
calculateTimings
();
$timings
=
$this
->
calculateTimings
();
...
@@ -59,6 +65,9 @@ EOD;
...
@@ -59,6 +65,9 @@ EOD;
return
$queryCount
>
0
?
$output
:
''
;
return
$queryCount
>
0
?
$output
:
''
;
}
}
/**
* @inheritdoc
*/
public
function
getDetail
()
public
function
getDetail
()
{
{
$timings
=
$this
->
calculateTimings
();
$timings
=
$this
->
calculateTimings
();
...
...
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