The sfDimensions plugin can achieve this for you - and more. http://trac.symfony-project.com/wiki/ysfDimensionsPlugin
You have one dimension for each client, set the dimension in the config file ( eg by domain name ). Then have a databases.yml file for each dimension ( client ). Works like a dream - plus gives you the option to have app.yml, templates, actions per client - or just overall files for all clients, with maybe just the CSS files and database connection different. Also keeps the project very easy to understand and follow as all files are where you would expect them to be, just in a folder with the name of the dimension. That also makes it easy with svn to see which files have been changed, and hence which clients website needs to be tested post change. Cheers David [EMAIL PROTECTED] wrote: > I'm using one project for many clients, each client has an own > database (security reasons). I am also using database sessions, so > using filters (as in many snippets) for changing database connection > is not possible. > > Here is the way i did it: i created a controller (extended > sfFrontWebController) and change the connection settings during > "initialize". This works only with directly changing the datasource > array of propel: > > Example: > $c = Propel::getConfiguration(); > $c['datasources']['propel']['connection']['dsn'] = ' ... new dsn > setting ...'; > Propel::setConfiguration($c); > > My question: > Is this the right way to do that (extending controller)? Are there > better ways? I think this is the only point where i can do it BEFORE > the session is started (and after factories are loaded). > > And is there a nicer way to change the propel settings? I tried all > snippets (via DatabbaseManager, setConnectionParameter, setParameter, > etc) but none of them worked (why?). Only the three lines above did > the job. > > Michael > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony developers" 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-devs?hl=en -~----------~----~----~----~------~----~------~--~---
