List db connection

Hi guys , I want list all db connections from my config, all with class yii\db\Connection

This is possible?

For example:


 'db_1' => 

        [

            'class' => 'yii\db\Connection',

            'dsn' => 'sqlsrv:Server=172.0.0.1;Database=DB1;ConnectionPooling=0',

            'username' => '',

            'password' => '',

            'charset' => 'utf8',

            'enableSchemaCache' => true,

            'schemaCacheDuration' => 3600,

            'schemaCache' => 'cache',

        ],

        'db_2' => 

        [

            'class' => 'yii\db\Connection',

            'dsn' => 'sqlsrv:Server=172.0.0.1;Database=DB2;ConnectionPooling=0',

            'username' => '',

            'password' => '',

            'charset' => 'utf8',

            'enableSchemaCache' => true,

            'schemaCacheDuration' => 3600,

            'schemaCache' => 'cache',

        ],

I need get [‘db_1’,‘db_2’]

If I read Yii::$app, I look my connections, but in a large array inside [color="#333333"][font="Menlo, Monaco, Consolas,"][_definitions:yii\di\ServiceLocator:private] , I dont think that´s it.[/font][/color]

Thanks :)

Yii::$app->getComponents(true) then iterate through configs and check for class.

Ohh, yes, thanks SamDark, you are the best.