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
e2e02c4b
Commit
e2e02c4b
authored
Oct 15, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'klimov-paul-mongodb-debug-short'
parents
5071fcde
1e40bc75
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
89 additions
and
2 deletions
+89
-2
DbPanel.php
extensions/debug/panels/DbPanel.php
+8
-0
detail.php
extensions/debug/views/default/panels/db/detail.php
+1
-1
summary.php
extensions/debug/views/default/panels/db/summary.php
+1
-1
CHANGELOG.md
extensions/mongodb/CHANGELOG.md
+1
-0
README.md
extensions/mongodb/README.md
+26
-0
MongoDbPanel.php
extensions/mongodb/debug/MongoDbPanel.php
+52
-0
No files found.
extensions/debug/panels/DbPanel.php
View file @
e2e02c4b
...
@@ -48,6 +48,14 @@ class DbPanel extends Panel
...
@@ -48,6 +48,14 @@ class DbPanel extends Panel
}
}
/**
/**
* @return string short name of the panel, which will be use in summary.
*/
public
function
getSummaryName
()
{
return
'DB'
;
}
/**
* @inheritdoc
* @inheritdoc
*/
*/
public
function
getSummary
()
public
function
getSummary
()
...
...
extensions/debug/views/default/panels/db/detail.php
View file @
e2e02c4b
...
@@ -7,7 +7,7 @@ use yii\helpers\Html;
...
@@ -7,7 +7,7 @@ use yii\helpers\Html;
use
yii\grid\GridView
;
use
yii\grid\GridView
;
?>
?>
<h1>
Database
Queries
</h1>
<h1>
<?=
$panel
->
getName
();
?>
Queries
</h1>
<?php
<?php
...
...
extensions/debug/views/default/panels/db/summary.php
View file @
e2e02c4b
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<?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
?>
."
>
DB
<span
class=
"label label-info"
>
<?=
$queryCount
?>
</span>
<span
class=
"label"
>
<?=
$queryTime
?>
</span>
<?=
$panel
->
getSummaryName
()
?>
<span
class=
"label label-info"
>
<?=
$queryCount
?>
</span>
<span
class=
"label"
>
<?=
$queryTime
?>
</span>
</a>
</a>
</div>
</div>
<?php
endif
;
?>
<?php
endif
;
?>
extensions/mongodb/CHANGELOG.md
View file @
e2e02c4b
...
@@ -23,6 +23,7 @@ Yii Framework 2 mongodb extension Change Log
...
@@ -23,6 +23,7 @@ Yii Framework 2 mongodb extension Change Log
-
Enh #3520: Added
`unlinkAll()`
-method to active record to remove all records of a model relation (NmDimas, samdark, cebe)
-
Enh #3520: Added
`unlinkAll()`
-method to active record to remove all records of a model relation (NmDimas, samdark, cebe)
-
Enh #3778: Gii generator for Active Record model added (klimov-paul)
-
Enh #3778: Gii generator for Active Record model added (klimov-paul)
-
Enh #3947: Migration support added (klimov-paul)
-
Enh #3947: Migration support added (klimov-paul)
-
Enh #3855: Enh: Added a debug toolbar panel for MongoDB (klimov-paul)
-
Enh #4048: Added
`init`
event to
`ActiveQuery`
classes (qiangxue)
-
Enh #4048: Added
`init`
event to
`ActiveQuery`
classes (qiangxue)
-
Enh #4086: changedAttributes of afterSave Event now contain old values (dizews)
-
Enh #4086: changedAttributes of afterSave Event now contain old values (dizews)
-
Enh #4335:
`yii\mongodb\log\MongoDbTarget`
log target added (klimov-paul)
-
Enh #4335:
`yii\mongodb\log\MongoDbTarget`
log target added (klimov-paul)
...
...
extensions/mongodb/README.md
View file @
e2e02c4b
...
@@ -288,6 +288,32 @@ return [
...
@@ -288,6 +288,32 @@ return [
is very basic and definitely requires adjustments.
is very basic and definitely requires adjustments.
Using the MongoDB DebugPanel
----------------------------
The yii2 MongoDB extensions provides a debug panel that can be integrated with the yii debug module
and shows the executed MongoDB queries.
Add the following to you application config to enable it (if you already have the debug module
enabled, it is sufficient to just add the panels configuration):
```
php
// ...
'bootstrap'
=>
[
'debug'
],
'modules'
=>
[
'debug'
=>
[
'class'
=>
'yii\\debug\\Module'
,
'panels'
=>
[
'mongodb'
=>
[
'class'
=>
'yii\\mongodb\\debug\\MongoDbPanel'
,
],
],
],
],
// ...
```
Using Migrations
Using Migrations
----------------
----------------
...
...
extensions/mongodb/debug/MongoDbPanel.php
0 → 100644
View file @
e2e02c4b
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace
yii\mongodb\debug
;
use
yii\debug\panels\DbPanel
;
use
yii\log\Logger
;
/**
* MongoDbPanel panel that collects and displays MongoDB queries performed.
*
* @author Klimov Paul <klimov@zfort.com>
* @since 2.0
*/
class
MongoDbPanel
extends
DbPanel
{
/**
* @inheritdoc
*/
public
function
getName
()
{
return
'MongoDB'
;
}
/**
* @inheritdoc
*/
public
function
getSummaryName
()
{
return
'MongoDB'
;
}
/**
* Returns all profile logs of the current request for this panel.
* @return array
*/
public
function
getProfileLogs
()
{
$target
=
$this
->
module
->
logTarget
;
return
$target
->
filterMessages
(
$target
->
messages
,
Logger
::
LEVEL_PROFILE
,
[
'yii\mongodb\Collection::*'
,
'yii\mongodb\Query::*'
,
'yii\mongodb\Database::*'
,
]);
}
}
\ No newline at end of file
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