You can use php in yml files:
all:
doctrine:
class: sfDoctrineDatabase
param:
dsn: '<?php echo DSN_CONSTANT ?>'
username: '<?php echo $_ENV['DB_USERNAME'] ?>'
password: '<?php echo $_ENV['DB_PASSWORD'] ?>'
EDIT:
The above way will store credentials on filesystem, in php files. If you want to prevent this, change the class
to your own, extend it, and retrieve the credentials any other way you want, eg, enviroment variables:
class MyDoctrineDatabase extends sfDoctrineDatabase {
public function initialize($parameters = array())
{
$parameters['dsn'] = $_ENV['DSN'];
$parameters['username'] = $_ENV['DB_USERNAME'];
$parameters['password'] = $_ENV['DB_PASSWORD'];
return parent::initialize($parameters);
}
}