cvs: php-master-web /scripts mirror-test
| From: | Gabor Hojtsy | Date: | Sat, 07 Jun 2003 10:18:34 +0000 |
| Subject: | cvs: php-master-web /scripts mirror-test | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-18569@lists.php.net to get a copy of this message | ||
goba Sat Jun 7 06:18:34 2003 EDT
Modified files:
/php-master-web/scripts mirror-test
Log:
Let the mrirors check the manuals themselfs
Index: php-master-web/scripts/mirror-test
diff -u php-master-web/scripts/mirror-test:1.39 php-master-web/scripts/mirror-test:1.40
--- php-master-web/scripts/mirror-test:1.39 Sat Jun 7 05:39:23 2003
+++ php-master-web/scripts/mirror-test Sat Jun 7 06:18:34 2003
@@ -35,10 +35,6 @@
// Get all mirror sites, and count the index of them
foreach ($hosts as $index => $host) {
- // =======================================================================
- // Check the mirror-info.php page on this mirror site
- // =======================================================================
-
// Open port 80 on the mirror site
$fp = @fsockopen($host['hostname'], 80, $errno, $errstr, 15);
@@ -93,55 +89,6 @@
// Close socket
fclose($fp);
- // =======================================================================
- // Check that the /manual dir is working on this mirror
- // =======================================================================
-
- // Open port 80 on the mirror site
- $fp = @fsockopen($host['hostname'], 80, $errno, $errstr, 15);
-
- // If we were unable to open the port, continue with the next mirror
- if (!$fp) {
- $hosts[$index]['problem'] = "manual check: unable to connect";
- continue;
- }
-
- // GET the echo manual page from the registered hostname
- $rc = fputs($fp, "GET /manual/en/function.echo.php HTTP/1.0\r\nHost:
$host[hostname]\r\n\r\n");
-
- // If we were unable to write to socket, skip mirror site
- if ($rc === FALSE) {
- $hosts[$index]['problem'] = "manual check: unable to send request";
- continue;
- }
-
- // Set timeout to 5 seconds
- socket_set_timeout($fp, 5, 0);
-
- // Get lines from the socket, while we get past the HTTP headers
- // (HTTP headers and data have one empty line between them)
- do {
- $line = fgets($fp);
- // Skip this mirror if a location header is returned for
- // the manual page [Apache /manual alias in effect]
- if (strpos($line, "Location:") === 0) {
- continue 2;
- }
- } while ($line !== FALSE && $line != "" && $line != "\r\n"
&& $line != "\n");
-
- // If we were unable to pass the HTTP header, skip mirror site
- if ($line === FALSE || $line == "") {
- $hosts[$index]['problem'] = "manual check: didn't get past
headers";
- continue;
- }
-
- // Close socket
- fclose($fp);
-
- // =======================================================================
- // Update the host's data if everything seems to be all right
- // =======================================================================
-
// Put pieces into the $hosts array
$hosts[$index]['phpversion'] = $info[1];
@@ -166,6 +113,9 @@
if (preg_match("!^[a-zA-Z_]+$!", $info[5])) {
$hosts[$index]['lang'] = $info[5];
}
+
+ // Need to add manual-noalias check here,
+ // when the mirror sites get updated
}