On Thu, 28 Jan 2010, Tennis Smith wrote:

> I'm trying to set my default db based on an environment variable.  The
> definition looks like this in my databases.yml file:
> 
> test:
>   foo:
>     class:          sfPropelDatabase
>     param:
>       dsn:          <?= getenv('FOO_DB') ? getenv('FOO_DB') :
> 'mysql://root:@localhost/test_foo' ?>
> 
> 
> Should this work?  The idea is that if the env var FOO_DB has a value, it
> will be used as the dsn.

Why do you need to do this? You can have multiple environments in symfony 
and use multiple controllers to select between them.

PHP scripts normally dont run from a shell so most probably environment 
variables are not available.



-- 


-- 
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.

Reply via email to