Hi Eno, THanks for the reply. See inline.
-T On Fri, Jan 29, 2010 at 5:10 AM, Eno <[email protected]> wrote: > 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. > I need it for concurrency. I have a single (large) group of tests. Run serially, the tests take about 1/2 an hr. Each test requires a pre-configured database. So, I've made 4 copies of the database to enable 4 concurrent tests. Therefore, I need way to have the default dsn set to a particular db. Picking the db needs to be dynamic. The incoming request can come from one of only 4 possible ip addresses. Each address is assigned to a particular db. Thus, what is needed is a reliable way to take the incoming ip address, and then make sure a specific db is used. Make sense? > > PHP scripts normally dont run from a shell so most probably environment > variables are not available. > Well, this script is called from the shell, and some env vars are already available. But I'm not able to get the dsn to change in this way. Why? I'm not sure. > > > > -- > > > -- > 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]<symfony-users%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en. > > -- Tks, -T -- 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.
