title: Retrieve database names / dsn info from symfony / doctrine databases.yml
body: <p>I have a complex data structure that means I have not been able to fully use relationships defined in schema.yml for my model.</p>
  
  <p>Now I have some reporting queries which need to use tables from several databases.</p>
  
  <p>Because of the complexity of the model these queries are written in raw sql. So I need to use the database names in the query in order to select the correct databases for various tables.</p>
  
  <p>I am using symfony 1.4 and Doctrine 1.2</p>
  
  <p>How can I extract the database names for my current environment (Prod, Dev, Test etc) from databases.yml in order to use them in the raw sql queries?</p>