throw new Horde_Vcs_Exception('Unable to run ' . $cmd . ': ' . error_get_last());
}
+ $lines = stream_get_contents($pipe);
+ fclose($pipe);
+ $lines = explode("\n", $lines);
+
while (true) {
- $line = trim(fgets($pipe));
+ $line = trim(next($lines));
if (!strlen($line)) { break; }
if (strpos($line, ':') === false) {
throw new Horde_Vcs_Exception('Malformed log line: ' . $line);
switch (trim($key)) {
case 'Rev':
if ($this->_rev != $value) {
- fclose($pipe);
throw new Horde_Vcs_Exception('Expected ' . $this->_rev . ', got ' . $value);
}
break;
}
$log = '';
- $line = fgets($pipe);
+ $line = next($lines);
while ($line !== false && substr($line, 0, 1) != ':') {
$log .= $line;
- $line = fgets($pipe);
+ $line = next($lines);
}
$this->_log = trim($log);
'dstPath' => isset($matches[7]) ? $matches[7] : ''
), $statinfo);
- $line = fgets($pipe);
+ $line = next($lines);
}
-
- fclose($pipe);
}
/**