![]() |
|
|
|||||||
| Register | Forum FAQ | Search | Today's Posts | Mark Forums Read |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
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. |
|
||||
|
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 |
|
||||
|
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. |
|
||||
|
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. |
|
||||
|
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. |
| Thread Tools | |
| Display Modes | |
|
|