What we do in my work is to create an instance configuration. By doing this, we have 3 configurations depending on the environment in which the application runs.
- Local computer (debugging during programming).
- Development (used to test our code before clicking on production).
- Production (Live Environment).
Then we configure the configuration class to load the configuration, which has paths and data for our tools, depending on which environment we specify in our configuration file.
Basically, we have the Chooser.txt file, which will have the name of the configuration file in the file to start the environment. When we want to run it locally, we edit the Chooser.txt file on local_config.txt (we use .txt so that we can define certain configs, and then we .htaccess in the configuration directory so that no one can view it). When we click on the dev server, we then edit Chooser.txt to say dev_config.txt and so on. Then in dev_config.txt or local_config.txt we will have configuration variables for tools and php settings, etc ...
Now we install the tool in each environment, so we will have our tools and libraries in our local environment, dev and production. With our tools in a localized environment, it is much easier to perform testing when updating / putting so that you do not just fix the tools on the production server when you first tested them on the dev server.
source share