Hello all,
>>>>> "Knut" == Knut Urdalen <[EMAIL PROTECTED]> writes:
Knut> Christian Hammers wrote:
>> if (defined($key)) {
>> return (string)constant($key);
>> - } elseif (isset($_ENV[$key])) {
>> - return (string)$_ENV[$key];
>> + } elseif (isset($_SERVER[$key])) {
>> + return (string)$_SERVER[$key];
>> } else {
>> return $def;
>> }
>>
Knut> Hi,
Knut> I think it's safe to add the $_SERVER variable here, and
Knut> check it before $_ENV. But still keep $_ENV like this:
Knut> if (defined($key)) {
Knut> return (string)constant($key);
Knut> + } elseif (isset($_SERVER[$key])) {
Knut> + return (string)$_SERVER[$key];
Knut> } elseif (isset($_ENV[$key])) {
Knut> return (string)$_ENV[$key];
Knut> } else {
Knut> return $def;
Knut> }
Knut> Do you agree?
As regards $_ENV superglobal, depending on php.ini (parameter
variables_order) this variable may or may not be prefilled. In my
opinion we should not to much on php.ini and therefore should use
getenv() instead of at least in addition to $_ENV.
Regards,
Michael.