Create a connection in databases.yml per domain with the name of the
connection being the domain itself. In your Propel model classes (not used
Doctrine yet) you can override the doSelect(), retrieveByPk() etc methods to
take the domain into account:

parent::doSelect(Propel::getConnection(str_replace("www.", "",
sfRequest::getHost())));

On Wed, Oct 14, 2009 at 5:47 PM, Carlos Jorge Andrade <
[email protected]> wrote:

>
>
>
>
> On 14, Oct 2009, at 13:48 , Gareth McCumskey wrote:
>
> > First thing that goes through my mind is why you would want to do
> > that? databases.yml is where all database connections are defined
> > and you can create as many as you like in there.
>
> Imagine the exact same codebase to power two different sites.
> Like somesite.com and somesite.org, one document root... depending on
> the domain accessed, the db connection would change. How would one do
> that ?
>
> >
> >
> http://www.lampjunkie.com/2008/04/using-multiple-databases-in-symfony-with-propel/
> >
> > On Wed, Oct 14, 2009 at 1:04 PM, Davide Borsatto <[email protected]>
> > wrote:
> >
> > Hi everybody,
> >
> > Is there a way to specify the connection parameters (those normally
> > specified in databases.yml) via PHP? Maybe in the ProjectConfiguration
> > class, but how?
> >
> >
> >
> >
> > --
> > Gareth McCumskey
> > http://garethmccumskey.blogspot.com
> > twitter: @garethmcc
> >
> > >
>
>
> >
>


-- 
Gareth McCumskey
http://garethmccumskey.blogspot.com
twitter: @garethmcc

--~--~---------~--~----~------------~-------~--~----~
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