Welcome Guest, Not a member yet? Register   Sign In
Multiple Environments
#6

[eluser]CroNiX[/eluser]
I have a development site (local), testing site (remote) and live site (remote). All share a single codebase and use the environment settings as described in the user manual.

Basically, in index.php, if $_SERVER['SERVER_NAME'] == 'my.development.server', it sets environment to development. Then it will load the config for my environment (settings, db settings, etc) as described in the manual. The same for the other environments.

Then I use git to maintain the versions.
I develop on my local machine and make commits. When they are ready to test, I use git to push the changes to the testing server. After I verify everything is working correctly, I push the changes to the live server.

I'm sorry, but I don't want to explain how GIT works as it's very powerful and there is plenty of info on the web. But you don't have to "upload" your codebase to 3 different servers using ftp or anything. It maintains that for you and uses ssh. When you push a git commit, it only sends the changes of the files to the server and not reupload all files. It's very efficient and allows you to create new "branches" in git so you can work on different features separately and not always working on the main branch. This is very handy for "hotfixes", where there is an immediate emergency on the live server that needs to be fixed - but if you were days into a new feature how do you do that without uploading all of your (incomplete) current work? With a new branch for a hotfix. Bam. done.



Messages In This Thread
Multiple Environments - by El Forum - 03-11-2013, 12:10 PM
Multiple Environments - by El Forum - 03-11-2013, 10:04 PM
Multiple Environments - by El Forum - 03-11-2013, 11:34 PM
Multiple Environments - by El Forum - 03-12-2013, 09:04 AM
Multiple Environments - by El Forum - 03-12-2013, 11:31 AM
Multiple Environments - by El Forum - 03-12-2013, 12:49 PM
Multiple Environments - by El Forum - 03-12-2013, 01:26 PM
Multiple Environments - by El Forum - 03-12-2013, 01:38 PM
Multiple Environments - by El Forum - 03-12-2013, 01:45 PM
Multiple Environments - by El Forum - 03-12-2013, 01:46 PM
Multiple Environments - by El Forum - 03-12-2013, 01:52 PM
Multiple Environments - by El Forum - 03-12-2013, 01:53 PM
Multiple Environments - by El Forum - 03-12-2013, 01:56 PM
Multiple Environments - by El Forum - 03-12-2013, 02:16 PM
Multiple Environments - by El Forum - 03-12-2013, 02:19 PM
Multiple Environments - by El Forum - 03-12-2013, 03:38 PM
Multiple Environments - by El Forum - 03-12-2013, 08:35 PM
Multiple Environments - by El Forum - 03-12-2013, 09:09 PM



Theme © iAndrew 2016 - Forum software by © MyBB