Skip to content

Commit 2589912

Browse files
committed
use PHP's native stream_get_contents() instead of getInput function to read data from STDIN
1 parent e35ee4f commit 2589912

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

scm/eventum-cvs-hook

+1-14
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ if (in_array($msg, array('- Imported sources', '- New directory'))) {
5353
}
5454

5555
// get the full commit message
56-
$input = getInput();
56+
$input = stream_get_contents(STDIN);
5757
$commit_msg = rtrim(substr($input, strpos($input, 'Log Message:') + strlen('Log Message:') + 1));
5858

5959
// now parse the list of modified files
@@ -109,19 +109,6 @@ if (count($matches[1]) > 0) {
109109
}
110110
}
111111

112-
/**
113-
* Read STDIN until EOF.
114-
*
115-
* @return string STDIN that was read.
116-
*/
117-
function getInput() {
118-
$buffer = '';
119-
while (!feof(STDIN)) {
120-
$buffer .= fgets(STDIN);
121-
}
122-
return $buffer;
123-
}
124-
125112
/**
126113
* Fetch $url, return response and optionaly unparsed headers array.
127114
*

0 commit comments

Comments
 (0)