cvs: php-master-web /scripts mirror-test
| From: | Gabor Hojtsy | Date: | Sun, 05 Jan 2003 18:51:18 +0000 |
| Subject: | cvs: php-master-web /scripts mirror-test | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-14757@lists.php.net to get a copy of this message | ||
goba Sun Jan 5 13:51:18 2003 EDT
Modified files:
/php-master-web/scripts mirror-test
Log:
Uh, I am the bad guy again... Now us a much more different name, then used
in the database, to designate the new mirror update time received...
Index: php-master-web/scripts/mirror-test
diff -u php-master-web/scripts/mirror-test:1.19 php-master-web/scripts/mirror-test:1.20
--- php-master-web/scripts/mirror-test:1.19 Sun Jan 5 07:00:09 2003
+++ php-master-web/scripts/mirror-test Sun Jan 5 13:51:18 2003
@@ -19,7 +19,7 @@
mysql_select_db("php3");
// Get mirror information for all active mirrors (regardless of their type!)
-$query = "SELECT maintainer, hostname, id, has_search, lastupdated FROM mirrors WHERE active =
1";
+$query = "SELECT maintainer, hostname, id, has_search FROM mirrors WHERE active = 1";
$result = mysql_query($query)
or die("unable to get from the database: " . mysql_error());
@@ -79,7 +79,7 @@
// The last updated date is a number [db security]
if (is_numeric($info[2])) {
- $hosts[$i]['lastupdated'] = $info[2];
+ $hosts[$i]['mirrorupdated'] = $info[2];
}
// If new search information is available, override previous one
@@ -91,11 +91,11 @@
// Go through all mirror sites checked
for($i=0; $i < $total; $i++) {
- // If lastupdated date specified, then we were able to check
+ // If "mirrorupdated" date specified, then we were able to check
// the mirror, so the mirror data can be updated. Otherwise
// the previous data need to be kept!
- if ($hosts[$i]['lastupdate']) {
- $query = "UPDATE mirrors SET
lastchecked=NOW(),has_search=".$hosts[$i]['has_search'].",lastupdated=FROM_UNIXTIME(".$hosts[$i]['lastupdated']."),phpversion='".addslashes($hosts[$i]['phpversion'])."'
WHERE hostname = '" . $hosts[$i]['hostname'] . "'";
+ if (isset($hosts[$i]['mirrorupdated'])) {
+ $query = "UPDATE mirrors SET
lastchecked=NOW(),has_search=".$hosts[$i]['has_search'].",lastupdated=FROM_UNIXTIME(".$hosts[$i]['mirrorupdated']."),phpversion='".addslashes($hosts[$i]['phpversion'])."'
WHERE hostname = '" . $hosts[$i]['hostname'] . "'";
$result = mysql_query($query) or die("unable to update the database: $query:
".mysql_error());
}
}