[Phpmyadmin-devel] Re: about the absence of config.inc.php

Michal Čihař michal at cihar.com
Tue Apr 11 06:50:06 CEST 2006


Hi

On Tue, 11 Apr 2006 15:27:39 +0200
Sebastian Mendel <lists at sebastianmendel.de> wrote:

> Michal Čihař schrieb:
> > On Tue, 11 Apr 2006 14:45:28 +0200
> > Sebastian Mendel <lists at sebastianmendel.de> wrote:
> >
> >> the reason why i dropped check for $_SERVER/$_ENV was i thoguth there is
> >> no need for this function-call-overhead for checking this arrays - as
> >> normally getenv() should always work.
> >
> > getenv can not work when something is _only_ a server variable but not
> > in environment.
> 
> What do you exactly mean with 'server' and 'environment'?
> 
> no $_SERVER variable is in $_ENV

and variable not in _ENV is not returned by getenv.

Just try this code:


foreach($_SERVER as $key => $val) {
        if ($val != getenv($key)) {
                echo "$key differs from _SERVER\n";
                echo "$key = $val / " . getenv($key) . "\n";
        }
}
foreach($_ENV as $key => $val) {
        if ($val != getenv($key)) {
                echo "$key differs from _ENV\n";
                echo "$key = $val / " . getenv($key) . "\n";
        }
}

Most likely some variables from _SERVER are not available throught
getenv:

PHP_SELF differs from _SERVER
PHP_SELF = test.php /
SCRIPT_NAME differs from _SERVER
SCRIPT_NAME = test.php /
SCRIPT_FILENAME differs from _SERVER
SCRIPT_FILENAME = test.php /
PATH_TRANSLATED differs from _SERVER
PATH_TRANSLATED = test.php /
REQUEST_TIME differs from _SERVER
REQUEST_TIME = 1144763136 /

-- 
	Michal Čihař | http://cihar.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.phpmyadmin.net/pipermail/developers/attachments/20060411/cd0a2559/attachment.sig>


More information about the Developers mailing list