Op Wednesday 27 May 2009 20:48:33 schreef Eugen_cro: > I have one theoretical question: lets say I have a web application that > would be used by 10-20-30 different sites (they will all be hosted on same > server). > It's still in early stage of development and I don't want to get too far > ahead of my self :) > > Since the code will be practically the same (library and mvc) what would be > the best option so I don't have to duplicate code over and over again > (except storage, that will be pain in the ass to update later).. > > Sites would only be different in domain ofc, database and public directory. > I was thinking to make some sort of configuration in each public/index.php > and then pass those options to bootstrap (like domain, title, path to > public, database info, etc..).. > Now I'm not quite sure how good is this idea, so any suggestions are more > then welcome. > > ----- > Regards, Eugen
Hi Eugen, I have had the same thoughts about this subject. For me, I'd like to have one cms to control multiple websites at the same time, but the implementation is almost the same as yours. You need for each different website a different public folder to store the styles, scripts and images. I think you should remove the application.ini from you application directory and put it in the public dir of the specific website, but it involves a big security issue (an ini file is for sure readable by a webbrowser). You could change it into a php array, but this is still not the best option (you just placed the whole application out of your webroot). The other option is to make the application.ini not readable by others except for www-data (your apache user). The last option (and I think it's the best one) is to rename the application.ini to yourwebsitename.ini and put all the different configs in application/config. In the public/index.php you could set a constant containing the name of the website (just like APPLICATION_PATH and APPLICATION_ENV). If there are more options, please let me know. Regards, Jurian -- Jurian Sluiman Soflomo.com
