Date: Sat, 26 May 2007 20:23:27 -0400
From: David Krings <[EMAIL PROTECTED]>
Subject: [nyphp-talk] $_SERVER
To: NYPHP Talk <talk@lists.nyphp.org>
Hi!
Every web server generates a different $_SERVER array in PHP. I got
burnt by it once. I used several keys/values that are present in the
Luckasoft EnginServer, but not in Apache. I am sure that IIS again
has a
different $_SERVER and the whole picture may look different on
Linux or
Mac OS.
The question of the day is: Which keys/values are guaranteed to be
present in $_SERVER on all/most of the modern servers?
David
Hi David,
This may or may not be helpful for your specific situation, but I
wrote a $_SERVER compatibility layer into Cake in the form of an env
() function, which you can check out here:
https://trac.cakephp.org/browser/branches/1.2.x.x/cake/basics.php#L978
It's not super-comprehensive, but it covers the basics, and uses
fallback accessors if the $_SERVER variable is disabled entirely (I
know Yahoo! does this, as there are some advantages in reduced
overhead).
- Nate
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com
Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php