Seamless Redesign
November 21, 2005 (0 comments)
At work, we decided to go up with our newest version of the website that I've been playing around with. It still needs work, but we figured now was as good of a time as ever. When I got the OK, I was a little nervous, mainly because I really can't stand when customers have to see errors that are my fault. Luckily, the transition was as smooth as a baby's bottom and it went through with no errors visible to the end user.
What I had done was create a folder where all of my code went, mainly my classes I had built. I put each class in a separate file and categorized them with folders. I named this folder library (how creative, huh?). This was the first piece that made things go so smoothly and so quickly. I knew I did that for a reason when I first built it, but it never really showed its value until now. The next thing I did was create an .htaccess file with a line in it to define an include path for each folder in the library folder.
php_value include_path ".:/home/user/library/database/"
This allowed me to write include('class.mysql.php'); rather than the full path of the file /home/user/library/database/class.mysql.php. I could now upload a new library folder to a different location, change the include path in the .htaccess file, and the site would instantly change to the newest version. No errors occurred when uploading because the .htaccess file was still pointing at the older library folder. Talk about a hole in one.
As a cool little side note, if you happen to be using Textmate for OS X, it has a built-in feature for writing Markdown. It will even allow you to preview it in HTML right there on the screen... no joke.