com web/master: Another brick in the wall.... of getting the sponsorship information to appear as normal on the round-robin-enabled hosts.:
fetch/mirrors.php scripts/mirror-test
| From: | Daniel P. Brown | Date: | Wed, 10 Oct 2012 20:08:11 +0000 |
| Subject: | com web/master: Another brick in the wall.... of getting the sponsorship information to appear as normal on the round-robin-enabled hosts.: fetch/mirrors.php scripts/mirror-test |
||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-14827@lists.php.net to get a copy of this message | ||
Commit: 3745009680fde415ea63f2f104650616b1d3c3f2
Author: Daniel P. Brown <danbrown@php.net> Wed, 10 Oct 2012 16:08:11 -0400
Parents: 362df9a7de81260bec6deee307f28201a0a7c170
Branches: master
Link: http://git.php.net/?p=web/master.git;a=commitdiff;h=3745009680fde415ea63f2f104650616b1d3c3f2
Log:
Another brick in the wall.... of getting the sponsorship information to appear as normal on the
round-robin-enabled hosts.
Changed paths:
M fetch/mirrors.php
M scripts/mirror-test
Diff:
diff --git a/fetch/mirrors.php b/fetch/mirrors.php
index e31a43d..4946e61 100644
--- a/fetch/mirrors.php
+++ b/fetch/mirrors.php
@@ -94,6 +94,13 @@ if (@mysql_connect("localhost","nobody","")) {
" \"$row[cc]\", \"$row[providername]\",
$row[has_stats],\n" .
" \"$row[providerurl]\", $row[mirrortype],
$row[has_search],\n" .
" \"$row[lang]\", $status),\n";
+
+ // Do the same with the IPv4 address as the hostname, for round-robin CC base hosts
+ echo ' "'.$row['ipv4_addr'].'" =>
array('.PHP_EOL .
+ ' "'.$row['cc'].'",
"'.$row['providername'].'",
'.$row['has_stats'].','.PHP_EOL .
+ ' "'.$row['providerurl'].'",
'.$row['mirrortype'].',
'.$row['has_search'].','.PHP_EOL .
+ ' "'.$row['lang'].'",
'.$status.'),'.PHP_EOL;
+
}
echo ");\n";
}
diff --git a/scripts/mirror-test b/scripts/mirror-test
index 3f7a6c2..54f583b 100755
--- a/scripts/mirror-test
+++ b/scripts/mirror-test
@@ -228,6 +228,20 @@ foreach ($hosts as $index => $host) {
$hosts[$index]['ext_avail'] = 'N/A';
}
+ // Get the system's local hostname
+ if (isset($info[9])) {
+ $hosts[$index]['local_hostname'] = $info[9];
+ } else {
+ $hosts[$index]['local_hostname'] = 'unknown-host.php.net';
+ }
+
+ // Get the system's IP address
+ if (isset($info[10])) {
+ $hosts[$index]['ipv4_addr'] = $info[10];
+ } else {
+ $hosts[$index]['ipv4_addr'] = '0.0.0.0';
+ }
+
// Check if mirror has correct ServerName/ServerAlias entries
// Most likely cause is unofficial hostname as ServerName instead of ServerAlias
// Important to keep my php.net cookie around
@@ -356,7 +370,9 @@ foreach ($hosts as $host) {
"phpversion = '" . addslashes($host['phpversion']) .
"', " .
"lang = '" . $host['lang'] .
"', " .
"ocmt = '', " .
- "ext_avail = '" . mysql_real_escape_string($host['ext_avail']) .
"' " .
+ "ext_avail = '" .
mysql_real_escape_string($host['ext_avail']) . "', " .
+ "local_hostname = '" .
mysql_real_escape_string($host['local_hostname']) . "', " .
+ "ipv4_addr = '" .
mysql_real_escape_string($host['ipv4_addr']) . "' " .
"WHERE hostname = '" . $host['hostname'] .
"'";
$result = mysql_query($query) or die("unable to update the database: $query: " .
mysql_error());