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;
*/
class
Panel
extends
Component
{
/**
* @var string panel unique identifier.
* It is set automatically by the container module.
*/
public
$id
;
/**
* @var string request data set identifier.
*/
public
$tag
;
/**
* @var Module
*/
public
$module
;
/**
* @var mixed data associated with panel
*/
public
$data
;
/**
* @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;
*/
class
MailPanel
extends
Panel
{
/**
* @var string path where all emails will be saved. should be an alias.
*/
...
...
@@ -35,6 +34,9 @@ class MailPanel extends Panel
*/
private
$_messages
=
[];
/**
* @inheritdoc
*/
public
function
init
()
{
parent
::
init
();
...
...
@@ -74,16 +76,25 @@ class MailPanel extends Panel
});
}
/**
* @inheritdoc
*/
public
function
getName
()
{
return
'Mail'
;
}
/**
* @inheritdoc
*/
public
function
getSummary
()
{
return
Yii
::
$app
->
view
->
render
(
'panels/mail/summary'
,
[
'panel'
=>
$this
,
'mailCount'
=>
count
(
$this
->
data
)]);
}
/**
* @inheritdoc
*/
public
function
getDetail
()
{
$searchModel
=
new
Mail
();
...
...
@@ -96,6 +107,9 @@ class MailPanel extends Panel
]);
}
/**
* @inheritdoc
*/
public
function
save
()
{
return
$this
->
getMessages
();
...
...
extensions/debug/views/default/index.php
View file @
dc9f9d92
<?php
use
yii\helpers\Html
;
use
yii\grid\GridView
;
use
yii\data\ArrayDataProvider
;
/**
* @var \yii\web\View $this
* @var array $manifest
...
...
@@ -12,6 +7,10 @@ use yii\data\ArrayDataProvider;
* @var \yii\debug\Panel[] $panels
*/
use
yii\helpers\Html
;
use
yii\grid\GridView
;
use
yii\data\ArrayDataProvider
;
$this
->
title
=
'Yii Debugger'
;
?>
<div
class=
"default-index"
>
...
...
extensions/debug/views/default/panels/config/table.php
View file @
dc9f9d92
...
...
@@ -13,7 +13,7 @@ use yii\helpers\Html;
<p>
Empty.
</p>
<?php
else
:
?>
<?php
else
:
?>
<table
class=
"table table-condensed table-bordered table-striped table-hover"
style=
"table-layout: fixed;"
>
<thead>
...
...
extensions/debug/views/default/panels/db/detail.php
View file @
dc9f9d92
<?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\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
)
:
?>
<div
class=
"yii-debug-toolbar-block"
>
<a
href=
"
<?=
$panel
->
getUrl
()
?>
"
title=
"Executed
<?=
$queryCount
?>
database queries which took
<?=
$queryTime
?>
."
>
...
...
extensions/debug/views/default/panels/log/detail.php
View file @
dc9f9d92
<?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\grid\GridView
;
use
yii\helpers\VarDumper
;
...
...
extensions/debug/views/default/panels/log/summary.php
View file @
dc9f9d92
<?php
/**
* @var yii\debug\panels\LogPanel $panel
* @var array $data
*/
use
yii\log\Target
;
use
yii\log\Logger
;
...
...
extensions/debug/views/default/panels/mail/_item.php
View file @
dc9f9d92
<?php
/**
* @var array $model
*/
use
yii\helpers\Html
;
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
;
echo
DetailView
::
widget
([
'model'
=>
$model
,
'attributes'
=>
[
'headers'
,
'from'
,
'to'
,
'charset'
,
[
'attribute'
=>
'time'
,
'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'
]]),
],
'model'
=>
$model
,
'attributes'
=>
[
'headers'
,
'from'
,
'to'
,
'charset'
,
[
'attribute'
=>
'time'
,
'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'
]]),
],
],
]);
extensions/debug/views/default/panels/mail/detail.php
View file @
dc9f9d92
<?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\ActiveForm
;
use
yii\helpers\Html
;
$listView
=
new
ListView
([
'dataProvider'
=>
$dataProvider
,
'itemView'
=>
'_item'
,
'layout'
=>
"
{
summary}\n{items}\n{pager
}
\n
"
,
]);
$listView
->
sorter
=
[
'options'
=>
[
'class'
=>
'mail-sorter'
]];
'dataProvider'
=>
$dataProvider
,
'itemView'
=>
'_item'
,
'layout'
=>
"
{
summary}\n{items}\n{pager
}
\n
"
,
]);
$listView
->
sorter
=
[
'options'
=>
[
'class'
=>
'mail-sorter'
]];
?>
<h1>
Email messages
</h1>
<div
class=
"row"
>
<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
class=
"row col-lg-10"
>
<?=
$listView
->
renderSorter
()
?>
...
...
@@ -25,24 +31,24 @@ $listView->sorter = ['options' => ['class'=>'mail-sorter']];
<div
id=
"email-form"
style=
"display: none;"
>
<?php
$form
=
ActiveForm
::
begin
([
'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"
>
<?=
$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"
>
<?=
Html
::
submitButton
(
'Filter'
,
[
'class'
=>
'btn btn-success'
])
?>
...
...
extensions/debug/views/default/panels/mail/summary.php
View file @
dc9f9d92
<?php
/**
* @var yii\debug\panels\MailPanel $panel
* @var integer $mailCount
*/
if
(
$mailCount
)
:
?>
<div
class=
"yii-debug-toolbar-block"
>
...
...
extensions/debug/views/default/panels/profile/detail.php
View file @
dc9f9d92
<?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\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"
>
<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>
...
...
extensions/debug/views/default/panels/request/detail.php
View file @
dc9f9d92
<?php
use
yii\bootstrap\Tabs
;
/**
* @var yii\debug\panels\RequestPanel $panel
*/
use
yii\bootstrap\Tabs
;
echo
"<h1>Request</h1>"
;
echo
Tabs
::
widget
([
...
...
extensions/debug/views/default/panels/request/summary.php
View file @
dc9f9d92
<?php
use
yii\helpers\Html
;
use
yii\web\Response
;
/**
* @var yii\debug\panels\RequestPanel $panel
*/
use
yii\helpers\Html
;
use
yii\web\Response
;
$statusCode
=
$panel
->
data
[
'statusCode'
];
if
(
$statusCode
===
null
)
{
$statusCode
=
200
;
...
...
extensions/debug/views/default/panels/request/table.php
View file @
dc9f9d92
<?php
use
yii\helpers\Html
;
use
yii\helpers\VarDumper
;
/**
* @var string $caption
* @var array $values
*/
use
yii\helpers\Html
;
use
yii\helpers\VarDumper
;
?>
<h3>
<?=
$caption
?>
</h3>
...
...
extensions/debug/views/default/toolbar.php
View file @
dc9f9d92
...
...
@@ -5,6 +5,7 @@
* @var string $tag
* @var string $position
*/
use
yii\helpers\Url
;
$minJs
=
<<<EOD
...
...
extensions/debug/views/default/view.php
View file @
dc9f9d92
<?php
use
yii\bootstrap\ButtonDropdown
;
use
yii\bootstrap\ButtonGroup
;
use
yii\helpers\Url
;
use
yii\helpers\Html
;
/**
* @var \yii\web\View $this
* @var array $summary
...
...
@@ -14,6 +8,11 @@ use yii\helpers\Html;
* @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'
;
?>
<div
class=
"default-view"
>
...
...
extensions/elasticsearch/DebugAction.php
View file @
dc9f9d92
...
...
@@ -28,9 +28,13 @@ class DebugAction extends Action
*/
public
$db
;
/**
* @var Panel
* @var
Debug
Panel
*/
public
$panel
;
/**
* @var \yii\debug\controllers\DefaultController
*/
public
$controller
;
public
function
run
(
$logId
,
$tag
)
{
...
...
extensions/elasticsearch/DebugPanel.php
View file @
dc9f9d92
...
...
@@ -33,11 +33,17 @@ class DebugPanel extends Panel
];
}
/**
* @inheritdoc
*/
public
function
getName
()
{
return
'Elasticsearch'
;
}
/**
* @inheritdoc
*/
public
function
getSummary
()
{
$timings
=
$this
->
calculateTimings
();
...
...
@@ -59,6 +65,9 @@ EOD;
return
$queryCount
>
0
?
$output
:
''
;
}
/**
* @inheritdoc
*/
public
function
getDetail
()
{
$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