cvs: php-master-web /scripts mirror-test
| From: | Gabor Hojtsy | Date: | Thu, 01 Jul 2004 20:25:42 +0000 |
| Subject: | cvs: php-master-web /scripts mirror-test | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-25195@lists.php.net to get a copy of this message | ||
goba Thu Jul 1 16:25:42 2004 EDT
Modified files:
/php-master-web/scripts mirror-test
Log:
try to prepare some correction data
http://cvs.php.net/diff.php/php-master-web/scripts/mirror-test?r1=1.66&r2=1.67&ty=u
Index: php-master-web/scripts/mirror-test
diff -u php-master-web/scripts/mirror-test:1.66 php-master-web/scripts/mirror-test:1.67
--- php-master-web/scripts/mirror-test:1.66 Wed Jun 30 16:14:48 2004
+++ php-master-web/scripts/mirror-test Thu Jul 1 16:25:42 2004
@@ -23,7 +23,8 @@
mysql_select_db("php3");
// Get mirror information for all active mirrors (regardless of their type!)
-$query = "SELECT maintainer, hostname, id, has_search, has_stats, lang, lastchecked,
+$query = "SELECT maintainer, hostname, id, has_search, has_stats, lang,
+ UNIX_TIMESTAMP(lastchecked) as lastchecked,
UNIX_TIMESTAMP(lastupdated) AS lastupdated
FROM mirrors WHERE active = 1";
$result = mysql_query($query)
@@ -45,7 +46,7 @@
$doublecheck = "Double checking " . count($dcheck) . "/" . count($hosts) .
" mirrors\n";
foreach ($dcheck as $mirrorinfo) {
$details = explode(" ", $mirrorinfo);
- $mirrmon[$details[0]] = array($details[1], $details[3]);
+ $mirrmon[$details[0]] = array($details[1], $details[3]); // age/undef and lastprobe/undef
}
}
else {
@@ -55,10 +56,17 @@
// Get all mirror sites, and count the index of them
foreach ($hosts as $index => $host) {
- // Diagnostical info
- $doublecheck .= $host['hostname'] . ' : ' .
- $host['lastupdated'] . "/" .
- $host['lastchecked'] . " --- " .
serialize($mirrmon["http://{$host['hostname']}/"])
. "\n";
+ if ($mirrmon["http://{$host['hostname']}/"][1]
!= 'undef' &&
+ $host['lastchecked'] < $mirrmon["http://{$host['hostname']}/"][1])
{
+ $hosts[$index]['correction']['check'] = $mirrmon["http://{$host['hostname']}/"][1];
+ }
+
+ if ($mirrmon["http://{$host['hostname']}/"][0]
!= 'undef' &&
+ $host['lastupdated'] < $mirrmon["http://{$host['hostname']}/"][0])
{
+ $hosts[$index]['correction']['update'] = $mirrmon["http://{$host['hostname']}/"][0];
+ }
+
+ $doublecheck .= $host['hostname'] . " " .
serialize($hosts[$index]['correction']);
// Open port 80 on the mirror site
$fp = @fsockopen($host['hostname'], 80, $errno, $errstr, 15);