Re: Container Functions Continued.....
| From: | David Otton | Date: | Sun, 10 Aug 2003 22:56:25 +0000 |
| Subject: | Re: Container Functions Continued..... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-159069@lists.php.net to get a copy of this message | ||
On Sun, 10 Aug 2003 18:04:00 -0400, you wrote:
>First of all, I understand the argument about having a testing, development
>and live servers, however, in the real world not every client can afford
>that hardware and it is not always feasable for smaller websites to have all
>the equipment.
The dev machine is the one you do your work on. The staging and live
machines can be the same physical hardware. Either VirtualHosts or
http://www.domain.com/
http://www.domain.com/newversion/
>What I am trying to accomplish is a function that can contain code blocks,
>like an if statement. Something that would operate like:
>
>developer_execute() {
> execute this code only
>}
>
>Where the function developer_execute would be defined as:
>function developer_execute() {
> if(getenv("REMOTE_ADDR")=="000.000.000.000") {
> %body
> }
>}
If eval()'s no good to you, then this problem is something like #defining
in/out blocks of debug code in C.
if (getenv ('REMOTE_ADDR') == '000.000.000.000') {
define ('TESTING', 1);
} else {
define ('TESTING', 0);
}
if (TESTING) {
echo (5+3);
}