|
26 | 26 | // | Authors: João Prado Maia <[email protected]> |
|
27 | 27 | // +----------------------------------------------------------------------+
|
28 | 28 | //
|
29 |
| -// @(#) $Id: process_cvs_commits.php 3284 2007-03-19 23:54:48Z glen $ |
| 29 | +// @(#) $Id: process_cvs_commits.php 3502 2007-12-05 10:34:30Z glen $ |
30 | 30 |
|
31 | 31 |
|
32 | 32 | // URL to your Eventum installation.
|
|
77 | 77 | }
|
78 | 78 |
|
79 | 79 | // get the full commit message
|
80 |
| -$commit_msg = substr($input, strpos($input, 'Log Message:')+strlen('Log Message:')+1); |
| 80 | +$commit_msg = substr($input, strpos($input, 'Log Message:') + strlen('Log Message:') + 1); |
81 | 81 |
|
82 | 82 | // parse the commit message and get the first issue number we can find
|
83 | 83 | $pattern = "/(?:issue|bug) ?:? ?#?(\d+)/i";
|
|
110 | 110 | die("Error: Could not ping the Eventum SCM handler script.\n");
|
111 | 111 | } else {
|
112 | 112 | $msg = "GET $ping_url HTTP/1.1\r\n";
|
113 |
| - $msg .= "Host: $data[host]\r\n"; |
| 113 | + $msg .= "Host: {$data['host']}\r\n"; |
114 | 114 | $msg .= "Connection: Close\r\n\r\n";
|
115 | 115 | fwrite($fp, $msg);
|
116 | 116 | $buf = fgets($fp, 4096);
|
117 |
| - list($proto, $status, $msg) = explode(' ', trim($buf), 3); |
118 |
| - if ($status != '200') { |
119 |
| - echo "Error: Could not ping the Eventum SCM handler script: HTTP status code: $status $msg\n"; |
120 |
| - } |
| 117 | + if (!$buf) { |
| 118 | + echo "Error: Couldn't read response from $ping_url\n"; |
| 119 | + } else { |
| 120 | + list($proto, $status, $msg) = explode(' ', trim($buf), 3); |
| 121 | + if ($status != '200') { |
| 122 | + echo "Error: Could not ping the Eventum SCM handler script: HTTP status code: $status $msg\n"; |
| 123 | + } |
| 124 | + } |
121 | 125 | fclose($fp);
|
122 | 126 | }
|
123 | 127 | }
|
|
0 commit comments