views:

90

answers:

3

I am looking for a php web framework that supports multiple databases with the same schema/model. Every customer of us will become his own webserver with his own database. On top of this we want to develop a central administration app that works on all customer databases, which are all have the same schema/model. Is there a php framework that supports such things?

+1  A: 

There's a couple good frameworks. Off the top of my head, CodeIgniter, CakePHP, Symfony, Zend...but in any case I'm willing to bet you're going to need to roll your own code to do exactly what you want to do.

Xorlev
+2  A: 

I'd recommend using Doctrine as an ORM. This makes it effortless to communicate with various databases without modifying code.

http://www.doctrine-project.org/

Your Models in the MVC will most likely use Doctrine. The rest of your application (the VC in MVC) can be built in Zend, Symfony, or whatever you'd like.

Eric
A: 

You can do this with any framework. I dont know whether you want to keep the codebase same or different. Assuming the codebase of all the installations are same, You can tweak the controller based on client session. The database connections and data directories (image, file folder etc) should be initialized based on client session and can live as persistent global variables.

A note on architecture : I dont know the nature of your application, but having multiple database and multiple codebase is a big maintenance issue. A full blown SaaS architecture save a lot of maintenance cost (http://en.wikipedia.org/wiki/Software_as_a_service)

Get in touch if you need further clarification.

shikhar
The customer app is no problem as they are all the same and work only with one database. The admin app is what worries us, as it has to connect to all the customer databases, which are all the the same schema.
Andre
for connection use a db user which has permission to all the clients database. Then write query with dbname.table_name and execute, this should work for mysql cant say abt other dbs
shikhar