mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-23 10:09:40 +08:00
Merge pull request #5566 from trntv/3855-mongodb-panel-bootstrap
implementing mongodb panel bootstrap behavior #3855
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.0.x-dev"
|
||||
}
|
||||
},
|
||||
"bootstrap": "yii\\mongodb\\debug\\MongoDbPanel"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
namespace yii\mongodb\debug;
|
||||
|
||||
use yii\base\Application;
|
||||
use yii\base\BootstrapInterface;
|
||||
use yii\debug\panels\DbPanel;
|
||||
use yii\log\Logger;
|
||||
|
||||
@@ -16,8 +18,21 @@ use yii\log\Logger;
|
||||
* @author Klimov Paul <klimov@zfort.com>
|
||||
* @since 2.0.1
|
||||
*/
|
||||
class MongoDbPanel extends DbPanel
|
||||
class MongoDbPanel extends DbPanel implements BootstrapInterface
|
||||
{
|
||||
/**
|
||||
* Bootstrap method to be called during application bootstrap stage.
|
||||
* @param Application $app the application currently running
|
||||
*/
|
||||
public function bootstrap($app)
|
||||
{
|
||||
$modules = $app->getModules();
|
||||
if(isset($modules['debug'])){
|
||||
$modules['debug']['panels']['mongodb'] = ['class'=>self::className()];
|
||||
}
|
||||
$app->setModules($modules);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
@@ -48,4 +63,5 @@ class MongoDbPanel extends DbPanel
|
||||
'yii\mongodb\Database::*',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user