Help - Search - Member List - Calendar
Full Version: Good methods of merging website/database changes.
WorkTheWeb Forums > General Talk > General Talk
Support our Sponsors!
ralford
Howdy,

Lemme introduce my situation.

I've been running Apache/MySQL/PHP on my own PC for about a year now, and have finally gotten "real" space for my webpage on Work the web. I've been basically running my site off my own machine, and have finally chosen to make it go live. It was pretty easy getting the database stuff copied up to my domain, but there were a few issues I ran into while I was getting it all up and running. These were mostly minor differences between my home setup and the setup on my website domain (absolute paths, and a few things in the directory structure that I wanted to keep different on my machine vs. on the web). For these issues I just began using two separate include files.

With everything set up on my machine and on the web, I simply make changes to them on my machine until I'm satisfied, then upload files and database changes. This gives me a level of confidence that things will not be broken when I merge the changes.

I was curious to see how other people go about merging their changes. Does anyone do anything similar or different? Anyone use a repository? What other ideas are out there?

Talk to you later
phpfreak
QUOTE(ralford @ Mar 1 2005, 03:32 AM)
Howdy,

Lemme introduce my situation.

I've been running Apache/MySQL/PHP on my own PC for about a year now, and have finally gotten "real" space for my webpage on Work the web.  I've been basically running my site off my own machine, and have finally chosen to make it go live.  It was pretty easy getting the database stuff copied up to my domain, but there were a few issues I ran into while I was getting it all up and running.  These were mostly minor differences between my home setup and the setup on my website domain (absolute paths, and a few things in the directory structure that I wanted to keep different on my machine vs. on the web).  For these issues I just began using two separate include files.

With everything set up on my machine and on the web, I simply make changes to them on my machine until I'm satisfied, then upload files and database changes.  This gives me a level of confidence that things will not be broken when I merge the changes. 

I was curious to see how other people go about merging their changes.  Does anyone do anything similar or different?  Anyone use a repository?  What other ideas are out there?

Talk to you later
*




Ryan,

A couple of tips would be to use relative paths from the web root. The web root is where your website begins. For example,

CODE
<img src="/images/foo.jpg" title="My Picture" />


And

CODE
<a href="/foo.php">Foo</a>


The forward slash basically takes you back to http://www.yourdomain.com or whatever your web root is and then you start the hierarchy from there to the file you wish to utilize.

As far as PHP include files and etc, you should learn to use the proper super globals:

CODE
<?php
include ($_SERVER['DOCUMENT_ROOT'].'/myfile.php';
?>


Using the above methods will allow you portability in your website. You can move it from one web server to another without any problems! It doesn't matter if your document root is C:\my_Website on a Windows machine or /home2/mysername/public_html on a Linux machine!

The only time that will get you into trouble is when you upload into a subdirectory on the live website, or change the directory structure under your Document Root by FTP'ng to a different directory.

I hope that info helps!

PHP Help | Linux Help | Web Hosting | Reseller Hosting | SSL Hosting
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2006 Invision Power Services, Inc.