sorry to trouble you this much. I just want to know that is it possible to have a dynamic data in the database.yml file. This is to be able shift my connection whenever i want to to other database. If it is possible, can you please elaborate how its done, what is the involve processes and why it is needed.
I would say it is not possible to have something like variables inside the databases.yml files without using dirty tricks on the command line etc. But you can define multiple databases (as for testing) or you can load the databases.yml at runtime,
$file = sfConfig::get('sf_config_dir').'/databases.yml';
$content = file_get_contents($file);
and change it with a preg_replace for the dsn. This should work but I would really not use it.