• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
One application with different sets of configs

[eluser]Alexander Weps[/eluser]
I would like If my application could use different configs (database.php, config.php, customconfigs) based on some variable passed on from index.php. So the application would be same for all clients, but they would use different databases etc.

The normal way to appraoch this sort of thing would be to store what each user sees in the database
You can then set a session variable for the group which they belong to, and in your controller constructor, show the content for that users group

[eluser]Alexander Weps[/eluser]
I would like to have one database per client, and even stylesheets per client, so I would like to move some configs elsewhere, to the client folder.

For the stylesheet per client
If you're going to have a large number of clients, you really don't wants to have hundreds (or thousands) of CSS files, if the main difference is stuff like colours, you could have a base stylesheet, and then just a string stored in the database with the override styles., or, you could store the whole CSS in the database.
You could also render the stylesheet on the fly using PHP

As for the database per client
You could have a main database (accessible via $this->db) which has all the users database settings, you can then create another database connection (and assign it to something like $this->client_db)

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.