cvs: php-master-web /scripts mirror-summary
| From: | Hannes Magnusson | Date: | Sat, 14 Apr 2007 12:51:56 +0000 |
| Subject: | cvs: php-master-web /scripts mirror-summary | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-35174@lists.php.net to get a copy of this message | ||
bjori Sat Apr 14 12:51:56 2007 UTC
Modified files:
/php-master-web/scripts mirror-summary
Log:
Add debug constant to disable mailing when testing
http://cvs.php.net/viewvc.cgi/php-master-web/scripts/mirror-summary?r1=1.18&r2=1.19&diff_format=u
Index: php-master-web/scripts/mirror-summary
diff -u php-master-web/scripts/mirror-summary:1.18 php-master-web/scripts/mirror-summary:1.19
--- php-master-web/scripts/mirror-summary:1.18 Sun Dec 24 12:36:44 2006
+++ php-master-web/scripts/mirror-summary Sat Apr 14 12:51:56 2007
@@ -7,6 +7,9 @@
contact details).
*/
+// Please edit this when testing to print the mail out, not send them to the list every time
+define("DEBUG", false);
+
// This script will run for a long time
set_time_limit (0);
@@ -98,13 +101,17 @@
$body .
"---------------------------------------------------------------------------------------\n";
-// Please edit this when testing to send mail to yourself, not to the list every time
+if(DEBUG) {
+ echo $body . "\n\n";
+} else {
mail(
"php-mirrors@lists.php.net",
"[mirrors] Status information",
$body,
"From: php-mirrors@lists.php.net"
);
+}
+
// Mail text for those mirror maintainers with inactive mirror sites
$inactives_text = "Hi!\n\nOur automatic mirror site check was unable to reach\n"
@@ -124,12 +131,16 @@
$last_error = "The last error message stored for your mirror is:\n
{$hostinfo[1]}\n\n";
}
else { $last_error = ""; }
+ if(DEBUG) {
+ echo $hostname. " - $last_error \n\n";
+ } else {
mail(
$hostinfo[0],
"$hostname mirror site deactivated",
str_replace("{{lasterror}}", $last_error, $inactives_text),
"From: php-mirrors@lists.php.net"
);
+ }
}
// Mail text for those mirror maintainers with outdated mirror sites
@@ -143,10 +154,14 @@
// Send mail to all outdated mirror maintainers
foreach ($outdated as $hostname => $hostinfo) {
+ if(DEBUG) {
+ echo $hostname . " - outdated\n\n";
+ } else {
mail(
$hostinfo[0],
"$hostname mirror site deactivated",
$outdated_text,
"From: php-mirrors@lists.php.net"
);
+ }
}