GlowHost Web Hosting Forums  

Go Back   GlowHost Web Hosting Forums > In The Lounge > Programming Talk
Register Forum FAQ Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-03-2008
charlesh's Avatar
Master Glow Jedi
 
Join Date: Aug 2006
Location: Wichita, Kansas - better than you imagined it would be.
Posts: 152
Rep Power: 37
charlesh is on a distinguished road
Default Testing to Production

I'm trying to come up with a good / easy way to go from the testing environment to a production by using php's define. This is pretty simple, I know, but it becomes more complicated when you add SSL and trying to keep URLs explicitly https, so you don't get any nasty warnings. The problem I seem to have is that all the links point to the live server, not the test one. I am planning to define a web root constant for the entire site and will change that once I go live with the changes from the test to the live site. But, before I change all those links, does anyone know a better way to do it?

Hmmm. What would John Marc do?
__________________
Charles H
http://www.harmonmediagroup.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 11-03-2008
Administrator
 
Join Date: Jan 2005
Posts: 33
Rep Power: 10
admin has disabled reputation
Default

Quote:
Originally Posted by charlesh View Post
Hmmm. What would John Marc do?
Depends on the day. Last I heard he was on a beach in Hawaii.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 11-03-2008
charlesh's Avatar
Master Glow Jedi
 
Join Date: Aug 2006
Location: Wichita, Kansas - better than you imagined it would be.
Posts: 152
Rep Power: 37
charlesh is on a distinguished road
Default

nice... Testing the waters, then.
__________________
Charles H
http://www.harmonmediagroup.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 11-03-2008
Matt's Avatar
chown -R us.us *YourBase*
 
Join Date: Jan 2005
Location: Moved to Florida!
Posts: 1,725
Rep Power: 10
Matt is a glorious beacon of lightMatt is a glorious beacon of lightMatt is a glorious beacon of lightMatt is a glorious beacon of lightMatt is a glorious beacon of lightMatt is a glorious beacon of light
Default

If you figure it out let us know how ya did it.
__________________
:::::
01001100 00110011 00110011 00110111
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 11-05-2008
jmarcv's Avatar
immoderate moderator
 
Join Date: Jan 2005
Posts: 297
Rep Power: 67
jmarcv is just really nicejmarcv is just really nicejmarcv is just really nicejmarcv is just really nicejmarcv is just really nice
Default

Ahhhh..... nice waters. Bummer that I had to jump into coming home to snow covered mountain pass closures......

I actually have 5 environments in my big system. I set up vars to choose which subdir I go to, ie:

http://mysite.com/app
http://mysite.com/appTEST
http://mysite.com/appQA

you get the idea.

Once in the env, all links are relative and stay within the env.

If that isnt apparent, point me to examples.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 11-06-2008
charlesh's Avatar
Master Glow Jedi
 
Join Date: Aug 2006
Location: Wichita, Kansas - better than you imagined it would be.
Posts: 152
Rep Power: 37
charlesh is on a distinguished road
Default

That's kinda what I was thinking. I was wondering, tho, how you deal with changing the vars. Do you use a php define() to switch between test and production?

Snow! What part of the country do you live in? I heard of some snow in South Dakota.

Charles
__________________
Charles H
http://www.harmonmediagroup.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 11-06-2008
jmarcv's Avatar
immoderate moderator
 
Join Date: Jan 2005
Posts: 297
Rep Power: 67
jmarcv is just really nicejmarcv is just really nicejmarcv is just really nicejmarcv is just really nicejmarcv is just really nice
Default

9,000 feet in Colorado has snow.... ughhhh....

Actually, what "I" do is to test the url:
if (ereg('/myappTEST/',$_SERVER['SCRIPT_FILENAME'])) $TEST=1;
if (ereg('/myapp/',$_SERVER['SCRIPT_FILENAME'])) $PROD=1;
You certainly can use defines, but it sounds like you are looking for something a bit different than what I do. I have links to go to the env and its pretty straightforward after that. I use vars, or could use defines so that I can post code to production but make sure test code does not execute unless we are in the test env.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 11-06-2008
charlesh's Avatar
Master Glow Jedi
 
Join Date: Aug 2006
Location: Wichita, Kansas - better than you imagined it would be.
Posts: 152
Rep Power: 37
charlesh is on a distinguished road
Default

Must be nice, actually. What part of CO? We like to go to Summitt (sp) county and ski at Copper and Breckenridge. We usually stay in Frisco.

I like the auto-test code above - yeah, basically I'm going to use defines in a config file and turn test on and off like a switch, but with your method, you can set it up automatically.

Speaking of Error handling, I've been reading a lot on classes and more object oriented approach to PHP, but haven't been able to take it really past a point that I use classes constantly and abstract classes, etc. I'm trying to "classify" some of my old code as I am needing to add some additional features. Error handling hasn't been one of my strong suits, but the try, catch, throw blocks seem a really useful feature. However, everyone has a different way to do error classes.
__________________
Charles H
http://www.harmonmediagroup.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 11-06-2008
jmarcv's Avatar
immoderate moderator
 
Join Date: Jan 2005
Posts: 297
Rep Power: 67
jmarcv is just really nicejmarcv is just really nicejmarcv is just really nicejmarcv is just really nicejmarcv is just really nice
Default

Crested Butte. Matt used to live here before he booked down to Florida.

Classes & Objects.... yeah, I really need to get a grip on those some day.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 11-06-2008
charlesh's Avatar
Master Glow Jedi
 
Join Date: Aug 2006
Location: Wichita, Kansas - better than you imagined it would be.
Posts: 152
Rep Power: 37
charlesh is on a distinguished road
Default

Matt,

Are you crazy? Got tired of the snow? High Altitude? Skiing? Low(er) home insurance rates? Florida is nice, too for 1/2 the time.

Here's a great book to check out - explains classes in php and objects in a way that is easy to understand - no $foo->$bar::fooBar();

Amazon.com: PHP Objects, Patterns, and Practice, Second Edition: Matt Zandstra: Books

And, John Marc, since you have such a good handle on the base language, using those classes would save you so much time in development. I can see how at this point and am trying to get there, but I still revert to my old ways... It ain't easy.
__________________
Charles H
http://www.harmonmediagroup.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

« hi | Force https »
Thread Tools
Display Modes

Posting Rules
You may post new threads
You may not post replies
You may not post attachments
You may edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 12:30 PM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO
Copyright 2000-2007 GlowHost.com