RyanSmith Posted July 13, 2005 Share Posted July 13, 2005 Hello, this is a little off topic for osC, but since the advice I'm seeking will be used for osC then I think it's apporiate to post it here. I'm a little new to CVS, and we have been starting to use it heavily in my company. I have a couple of osCommerce projects that I have added to our CVSNT repo. I usually work off of my local development machine, but I also need to perodically update or staging server with the new changes. It would be nice if I could just extract a copy of the site to the staging server and it would work. The problem are all the dynamic paths in the config files. Everytime it upload a new version from the CVS repo to the staging server I have to reconfigure all the paths to reflect the staging server settings. To make things worse, I am using the multi-shops contrib and it sets up paths dynamically in the database which I also have to go out and change. What does the community think is the best way of handling this. I imagine that this has to be a fairly common problem of websites having dynamic paths that need to be set differently on the dev machine and the production machine. Any ideas would be great, I would love to hear how other people handle this issue. Thanks. osCommerce is a great piece of software with wonderful contributions. Spend some time in the contribution area. There are a lot of gems there. Link to comment Share on other sites More sharing options...
FalseDawn Posted July 14, 2005 Share Posted July 14, 2005 The problem are all the dynamic paths in the config files. Everytime it upload a new version from the CVS repo to the staging server I have to reconfigure all the paths to reflect the staging server settings. This is pretty trivial - simply create 2 copies of the configure_files - eg configure_local and configure_staging. Modify configure_staging as required for your paths etc. After copying, rename your configure_staging files to configure.php in catalog and admin. This way you just need to make the configuration settings once, not keep changing them every time you upload files. Not familiar with multi shops contrib - what do you mean by "paths" in the database? Do you mean table names? Link to comment Share on other sites More sharing options...
Harald Ponce de Leon Posted July 14, 2005 Share Posted July 14, 2005 The configuration file in the includes/local/ directory is for this purpose, and is never overwritten by CVS due to the file being placed in the ignore list. , osCommerce Link to comment Share on other sites More sharing options...
RyanSmith Posted July 14, 2005 Author Share Posted July 14, 2005 The configuration file in the includes/local/ directory is for this purpose, and is never overwritten by CVS due to the file being placed in the ignore list. <{POST_SNAPBACK}> Thanks, I didn't realize that's what that is for. I guess the problem now is that with the multistores contrib many of those paths that are stored in the config file get moved to the database. I think the best way of handling this would be to run a SQL update script at application start, but I'm not sure where to put that code. I ASP I have a global.asa file that has a session_start function, what is an equivelent in PHP. If there isn't on, where would be the best place to run a script to update the database paths? Can you think of a better way of doing this? Thanks again for your responses. osCommerce is a great piece of software with wonderful contributions. Spend some time in the contribution area. There are a lot of gems there. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.