How do I set up a development environment to transition code to a website in real time?

In the past, I always edited all my sites live; Not too worried about my 2 visitors seeing an error message.

However, the day may come when I will receive more than two visitors. What would be the best approach to testing my changes and then making all the changes to life at the same time?

Do I have to copy and paste one single file into a subfolder and edit them, and then copy them when I am done? What if I have full URLs in my code (they will break if I translate them)? Maybe I can use .htaccess hacking to get around this? What about test database data? Should I spoof all my MySQL tables and reference them?

I am using CakePHP for a specific project that I'm worried about, but I'm curious to know what people take approaches with Cake (what can have tools for this?) And without a frame.


I get a lot of recommendations for SVN, which sounds great, but unfortunately my host does not support it: \

+5
source share
5 answers

The best you can do is create an intermediate environment in which you test your changes. An intermediate environment (ideally) is a complete working duplicate of your production system. This will prevent you from many headaches and unintentional production disruptions.

, , , ( ). , , , , .

+18

(git subversion). , , .

, . SQL, , . , , , .

URL- . , ... , , Javascript. URL- , /etc/hosts, , .

+5

, - ( , , , ..). , ; , . - , ( , SVN-, ).

-, , : URL- , . http://www.example.com/devweb http://www.example.com, http://www.example.com/devweb/foo/bar.php http://www.example.com/foo/bar.php .. devweb , , /devweb, . , .

+3

, CakePHP. , ( MySQL, IP-).

Subversion, - Hudson:

https://hudson.dev.java.net/

. subversion , script SSH/ . ( ), , , . CI, ( Xinc ).

http://code.google.com/p/xinc/

URL-, - , . , :)

, ...

+2
source

I have a version of config / database.php that uses the php server variable "SERVER NAME" to determine which system the application is running on. Then, when I clone my git repository on my home system, the development site (which uses the same specifications as in real time), and in real time they all connect to the corresponding databases.

I pasted here, but I also find that it is available in thebakery.

http://pastebin.com/f1a701145

+2
source

All Articles