How to access config database properties

Permalink
How do I access configuration parameters directly stored in database.php? I need to connect to a different database in some of my custom blocks and i want the config parameters stored in a common place. Or alternatively how do i use concretes database connection object to connect to the "other" database without trashing the connection to the original one.

return array(
'default-connection' => 'concrete',
'connections' => array(
'concrete' => array(
'driver' => 'c5_pdo_mysql',
'server' => 'localhost',
'database' => 'dbuerer_kingsforthekids',
'username' => 'dbuerer',
'password' => 'pass1',
'charset' => 'utf8'
),
'k4k' => array(
'driver' => 'c5_pdo_mysql',
'server' => 'localhost',
'database' => 'dbuerer_k4kevents',
'username' => 'dbuerer',
'password' => 'pass2',
'charset' => 'utf8'
)
)
);

View Replies:
dbuerer replied on at Permalink Reply
The answer, which i learned from this post: https://www.concrete5.org/community/forums/5-7-discussion/how-to-ove... is to use the format $dbServer = \Config::get('database.connections.k4k.server'); where
database is the name of the file in the config directory
connections.k4k.server refers to the element i want.

This will get me going for now - eventually i'd like to learn how to use concretes database helper to return the connection object directly but for now i'll create it manually in my package files.