Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Db panel extends \yii\debug\panels\DbPanel,But when I dont have connection which named 'db',It will not work. #239

Closed
Nash-x9 opened this issue Mar 2, 2018 · 1 comment

Comments

@Nash-x9
Copy link
Contributor

Nash-x9 commented Mar 2, 2018

Db panel extends \yii\debug\panels\DbPanel,But when I dont have connection which named 'db',It will not work.

My config like this:

<?php
return [
    'components' => [
        'read_data'=> [
             'class' => 'yii\db\Connection',
             //some other config
        ],
        'write_data'=> [
             'class' => 'yii\db\Connection',
            //some other config
        ],
    ],
];

That I don't have any Connection called 'db'.So it will throw these:
Invalid Configuration – yii\base\InvalidConfigException
Unknown component ID: db

@Blizzke
Copy link
Member

Blizzke commented Mar 2, 2018

The debug DbPanel assumes that a db connection is present.
Audit's DbPanel does nothing in that matter as it just overrides that class's logging functionality.

So to make this work you'll have to configure the panel with a db value that points to the correct connection.
Basically you can just set the 'db' => 'connection name' in your audit panel configuration and it will be used.
The Module Configuration should be able to help you further..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants