svn: SVNROOT/ commit-email.php post-commit

[email protected] (Gwynne Raskind) Fri, 17 Jul 09 11:28:19 +0000
Newsgroups php.cvs,svn.migration
Message-ID <[email protected]>
--6017735af0fd7d0e3b3623419a29de72352ed61b
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

gwynne		Fri, 17 Jul 2009 11:28:19 +0000

URL: http://svn.php.net/viewvc?view=revision&revision=284250

Changed paths:
	U   SVNROOT/commit-email.php
	U   SVNROOT/post-commit

Log:
cleanliness in commit-email, use a consistent DEBUG flag instead of repeating
annoying if checks

Modified: SVNROOT/commit-email.php
===================================================================
--- SVNROOT/commit-email.php	2009-07-17 11:13:51 UTC (rev 284249)
+++ SVNROOT/commit-email.php	2009-07-17 11:28:19 UTC (rev 284250)
@@ -211,13 +211,13 @@
         wordwrap(base64_encode($diffs), 80, "\r\n", TRUE) . "\r\n";
 }

-$msg_body .= "\r\n--{$boundary}--\r\n";
+$msg_body .= "\r\n--{$boundary}--";

 $complete_email = $msg_headers . "\r\n" . str_replace("\r\n.\r\n", "\r\n..\r\n", $msg_body);

 // -----------------------------------------------------------------------------------------------------------------------------
 // Send e-mail
-if (isset($_ENV['DEBUG']) && $_ENV['DEBUG'] == 'DEBUG') {
+if ($is_DEBUG) {
     $socket = fopen("php://stdout", "w");
 } else {
     $socket = fsockopen($smtp_server, getservbyname('smtp', 'tcp'), $errno);
@@ -238,7 +238,9 @@
     ".\r\n" .
     "QUIT\r\n");

-$discard = stream_get_contents($socket);
+if (!$is_DEBUG) {
+    $discard = stream_get_contents($socket);
+}
 fclose($socket);

 ?>

Modified: SVNROOT/post-commit
===================================================================
--- SVNROOT/post-commit	2009-07-17 11:13:51 UTC (rev 284249)
+++ SVNROOT/post-commit	2009-07-17 11:28:19 UTC (rev 284250)
@@ -16,6 +16,7 @@
 // -----------------------------------------------------------------------------------------------------------------------------
 // Constants
 $version = substr('$Revision$', strlen('$Revision: '), -2);
+$is_DEBUG = (isset($_ENV['DEBUG']) && $_ENV['DEBUG'] === 'DEBUG');

 // -----------------------------------------------------------------------------------------------------------------------------
 // Version check
@@ -63,7 +64,7 @@
 // -----------------------------------------------------------------------------------------------------------------------------
 // If SVNROOT had a commit, we need to update the admin copy
 if ($SVNROOT_changed) {
-    if (isset($_ENV['DEBUG']) && $_ENV['DEBUG'] == 'DEBUG') {
+    if ($is_DEBUG) {
         print "Updating SVNROOT...\n";
     }
     chdir(dirname(__FILE__));

--6017735af0fd7d0e3b3623419a29de72352ed61b--