cvs: phpweb /include site.inc
| From: | Gabor Hojtsy | Date: | Sat, 03 May 2003 20:11:20 +0000 |
| Subject: | cvs: phpweb /include site.inc | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-17268@lists.php.net to get a copy of this message | ||
goba Sat May 3 16:11:20 2003 EDT
Modified files:
/phpweb/include site.inc
Log:
Ups, only count active mirrors
Index: phpweb/include/site.inc
diff -u phpweb/include/site.inc:1.245 phpweb/include/site.inc:1.246
--- phpweb/include/site.inc:1.245 Sat May 3 16:07:23 2003
+++ phpweb/include/site.inc Sat May 3 16:11:20 2003
@@ -1,6 +1,6 @@
<?php // -*- C++ -*-
-// $Id: site.inc,v 1.245 2003/05/03 20:07:23 goba Exp $
+// $Id: site.inc,v 1.246 2003/05/03 20:11:20 goba Exp $
// Define $MIRRORS array, and some constants
include_once 'mirrors.inc';
@@ -116,13 +116,11 @@
// This is a non-identified country
if ($country == "NA") { return 0; }
- // Count all mirror sites
- elseif ($country === FALSE) { return count($MIRRORS); }
-
// Count only the ones in the same country
$count = 0;
foreach ($MIRRORS as $murl => $mirror) {
- if (mirror_country($murl) == $country) { $count++; }
+ if (mirror_status($murl) != MIRROR_OK) { continue; }
+ if ($country === FALSE || mirror_country($murl) == $country) { $count++; }
}
return $count;
}