1 Oct 11, 2007 14:02
For a clients website, I am implementing a prototype system into it, so we have a live, dev, beta, and test site.
So instead of working on the live site all the time, we use the appropriate protoype sites instead, and then push the updates on the live site when needed.
Now, due to ssl certificate issues, we are just using site.com/.dev/ and site.com/.beta/ etc with the site.com/ being the live site. (Instead of sub domains).
Now I have the .htaccess done fine so that if a file does not exist on the say the beta site, it uses a symlink/virtual redirect to the file on the live site.
Now all links inside the page are still done correctly as in all our links we use a BASE_URL constant that contains the url of whatever site we are on.
Now the tricky part is how I'm going to do the implementation on the PHP require/include side. And I cannot come up with a decision over 2 choices.
Choice 1: Just copy over the files you need to modify to the beta site as well as ALL DEPENDENCIES, modify the files, then copy them back over when needed.
- Code structure cleaner. - More portable.
- All dependencies need to be copied over. This could cause scratching heads if we are not sure which files need to be copied over from the beta to live site, or which files have the latest changes etc.
Choice 2: Make a handler for the all require/includes so require(f(dirname(__FILE__).'/file.php')); so that will check if that exists on the beta site (if we are currently on the beta site) and if we are then use that file, if not, use the file on the live site.
- Only files that need to be modified are copied over.
- File structure cleaner. - We know what files have b
- All files need to be modified to include the handler.
- To use the handler all files need to include the basic config file so that they have the f() function defined.
- Code structure is messier. - Portability goes down as handler is required.
Anyone got any ideas, advice, or expierence on this?