cvs: phpweb /include site.inc
| From: | Gabor Hojtsy | Date: | Sun, 22 Dec 2002 23:16:03 +0000 |
| Subject: | cvs: phpweb /include site.inc | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-14451@lists.php.net to get a copy of this message | ||
goba Sun Dec 22 18:16:03 2002 EDT
Modified files:
/phpweb/include site.inc
Log:
Adding some explanation on why SERVER_NAME and
HTTP_HOST are used (it is intentional, those are
not the same!)
Index: phpweb/include/site.inc
diff -u phpweb/include/site.inc:1.233 phpweb/include/site.inc:1.234
--- phpweb/include/site.inc:1.233 Sun Dec 22 08:17:58 2002
+++ phpweb/include/site.inc Sun Dec 22 18:16:03 2002
@@ -115,13 +115,18 @@
return $MIRRORS[$site][7];
}
-// Guess the current site from what Apache tells us
+// Guess the current site from what Apache tells us.
+// This should be the main name of the mirror (in case
+// it works under more then one name). SERVER_NAME is
+// the name of the Apache vhost.
$MYSITE = 'http://' . $_SERVER["SERVER_NAME"] .
'/';
// If this site does not exist
if (!isset($MIRRORS[$MYSITE])) {
- // Try the hostname [without www]
+ // Try the hostname [without www]. In case the main name above is
+ // not found, we try to find the mirror with the name provided by
+ // the browser (in the Host HTTP header).
$MYSITE = 'http://' . ereg_replace("^www\\.",
"", $_SERVER["HTTP_HOST"]) . '/';
// If the mirror is not registered with this name, provide defaults