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

From: Date: Fri, 17 Jul 2009 11:28:19 +0000
Subject: svn: SVNROOT/ commit-email.php post-commit
Groups: php.cvs svn.migration 
Request: Send a blank email to svn-migration+get-487@lists.php.net to get a copy of this message
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__));

« previous svn.migration (#487) next »