Commit:    d4f4266ed11d8b437df7cc414be3ff7258837691
Author:    Hannes Magnusson <bj...@php.net>         Tue, 26 May 2015 10:28:41 
-0700
Parents:   2e616dcce8c14a7d05b196b4a51672e92188c991
Branches:  master

Link:       
http://git.php.net/?p=web/master.git;a=commitdiff;h=d4f4266ed11d8b437df7cc414be3ff7258837691

Log:
Remove geo debugging. Print errors to stderr

Changed paths:
  M  scripts/mirror-test


Diff:
diff --git a/scripts/mirror-test b/scripts/mirror-test
index 8a89632..5d9e1d2 100755
--- a/scripts/mirror-test
+++ b/scripts/mirror-test
@@ -25,24 +25,20 @@ function lap() {
        $then = $now;
        return $ret;
 }
-function isGeoDebug() {
-       return getenv("PHPGEODEV");
-}
 function isDebug() {
        return getenv("PHPWEBDEV") || file_exists(".DEV");
 }
 function p($msg) {
-       if (isDebug()) {
-               echo $msg;
-       }
+       return fprintf(STDERR, "%s", $msg);
 }
 function email($address, $subject, $content) {
-       if (!getenv("PHPWEBDEV") && !file_exists(".DEV")) {
-               $headers = "From: mirr...@php.net";
-               $extrah  = "-fnore...@php.net";
-               return mail($address, $subject, $content, $headers, $extrah);
+       if (isDebug()) {
+               return fprintf(STDERR, "\n\nMailed %s -- %s\n%s\n\n", $address, 
$subject, $content);
        }
-       echo "\n\n\nMailed $address -- $subject\n$content\n\n\n";
+
+       $headers = "From: mirr...@php.net";
+       $extrah  = "-fnore...@php.net";
+       return mail($address, $subject, $content, $headers, $extrah);
 }
 function emailMirror($row, $problem) {
        $subject = "{$row["hostname"]} Disabled";
@@ -440,7 +436,6 @@ while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
        $HOSTS[$row["cname"]."."] = false;
 
 
-if(isGeoDebug()) {
        $filename = "/manual/noalias.txt";
        $content = fetch($row["cname"], $filename);
        if ($content != "manual-noalias") {
@@ -526,7 +521,6 @@ if(isGeoDebug()) {
        }
 
 
-}
        $content = fetch($row["cname"], "/mirror-info", $row["hostname"], 
$headers);
        if (!$content) {
                FAIL($row, "/mirror-info", "Received no response in 15 
seconds", $row["hostname"]);


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to