Code Comments
Programming Forum and web based access to our favorite programming groups.Hi, I have five sites using the same code, apart from images and database connection. I wanted to set them up so that they share the code and a config file sets up the individual bits. I'm currently on IIS so this is how I went about it. Set up a folder containing the php files. In that folder I have the following: folders --templates --images (contains common images used across all sites) and for each website --site_includes (contains config and image files) --site_templates_c --site_cache // added later --site_configs // added later For 'site' above, I replace with the virtual host name as used by IIS. I then set IIS to point the various virtual hosts to that main folder and the home.php checks the 'ORIG_PATH' to know which site it is in and then calls the appropriate site_includes folder and stores the 'site' in a cookie. Initially, I figured that the individual site_templates_C would keep the data from mixing across sites but that didn't work and I had images failing to display correctly and data traversing across the sites. I then created individual site_cache and site_configs folders for each site and that seems to be working fine. This might help someone else out the wanting to do something similar with Smarty. I'm not sure how this works with Apache, but As I'm migrating to Apache2 (win2003) in the new year, I'm going to find out. Cheers George
Post Follow-up to this message>>> site_templates_c $smarty already has a $compile_id var to help with this.. Thi smeans one can have one shared compile dir across all sites http://smarty.php.net/manual/en/variable.compile.id.php $smarty->compile_id = $_SERVER['SERVER_NAME']; $smarty->compile_dir = 'path/to/shared_compile_dir'; This is really useful - particullarily when upgrading smarty Pedro George Pitcher wrote: > Hi, > > I have five sites using the same code, apart from images and database > connection. > > I wanted to set them up so that they share the code and a config file sets > up the individual bits. > > I'm currently on IIS so this is how I went about it. > > Set up a folder containing the php files. In that folder I have the > following: > > folders > --templates > --images (contains common images used across all sites) > and for each website > --site_includes (contains config and image files) > --site_templates_c > --site_cache // added later > --site_configs // added later > > For 'site' above, I replace with the virtual host name as used by IIS. > > I then set IIS to point the various virtual hosts to that main folder and > the home.php checks the 'ORIG_PATH' to know which site it is in and then > calls the appropriate site_includes folder and stores the 'site' in a > cookie. > > Initially, I figured that the individual site_templates_C would keep the > data from mixing across sites but that didn't work and I had images failin g > to display correctly and data traversing across the sites. I then created > individual site_cache and site_configs folders for each site and that seem s > to be working fine. > > This might help someone else out the wanting to do something similar with > Smarty. I'm not sure how this works with Apache, but As I'm migrating to > Apache2 (win2003) in the new year, I'm going to find out. > > Cheers > > George
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.