Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Testing to Production

  1. #1
    charlesh's Avatar
    charlesh is offline Master Glow Jedi
    Join Date
    Aug 2006
    Location
    Atlanta, GA - better than you imagined it would be.
    Posts
    189

    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?

  2. #2
    admin is offline Administrator
    Join Date
    Jan 2005
    Posts
    69

    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.

  3. #3
    charlesh's Avatar
    charlesh is offline Master Glow Jedi
    Join Date
    Aug 2006
    Location
    Atlanta, GA - better than you imagined it would be.
    Posts
    189

    Default

    nice... Testing the waters, then.

  4. #4
    Matt's Avatar
    Matt is offline GlowHost Administrator
    Join Date
    Jan 2005
    Location
    Behind your monitor
    Posts
    5,256

    Default

    If you figure it out let us know how ya did it.
    Send your friends and site visitors to GlowHost and get $125 plus bonus!
    GlowHost Affiliate Program | Read our Blog | GlowHost's Facebook | Follow us on Twitter | GlowHost on Google+

  5. #5
    jmarcv's Avatar
    jmarcv is offline Cranky Coder
    Join Date
    Jan 2005
    Posts
    354

    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.

  6. #6
    charlesh's Avatar
    charlesh is offline Master Glow Jedi
    Join Date
    Aug 2006
    Location
    Atlanta, GA - better than you imagined it would be.
    Posts
    189

    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

  7. #7
    jmarcv's Avatar
    jmarcv is offline Cranky Coder
    Join Date
    Jan 2005
    Posts
    354

    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.

  8. #8
    charlesh's Avatar
    charlesh is offline Master Glow Jedi
    Join Date
    Aug 2006
    Location
    Atlanta, GA - better than you imagined it would be.
    Posts
    189

    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.

  9. #9
    jmarcv's Avatar
    jmarcv is offline Cranky Coder
    Join Date
    Jan 2005
    Posts
    354

    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.

  10. #10
    charlesh's Avatar
    charlesh is offline Master Glow Jedi
    Join Date
    Aug 2006
    Location
    Atlanta, GA - better than you imagined it would be.
    Posts
    189

    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.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16