Indefero

Indefero Commit Details


Date:2010-06-23 17:10:41 (14 years 5 months ago)
Author:Thomas Keller
Branch:develop, feature-issue_links, feature.better-home, feature.content-md5, feature.diff-whitespace, feature.download-md5, feature.issue-links, feature.issue-of-others, feature.issue-summary, feature.search-filter, feature.webrepos, feature.wiki-default-page, master, release-1.1, release-1.2, release-1.3
Commit:5ce324f35f2b43a8cd28141dc8eb688b92e444c2
Parents: e57fc18bcbdd5dc304e5b90bf5bd5e6727189603
Message:* clear the process environment and set LANG properly so we get english error codes and still keep utf8 compliant * rename _read to _readStdout and introduce a generic _readStderr which reads from the other pipe on failure

Changes:

File differences

src/IDF/Scm/Monotone.php
8181
8282
8383
84
84
85
86
87
8588
8689
8790
......
153156
154157
155158
156
157159
158
160
161
159162
160163
161164
......
215218
216219
217220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
218236
219237
220238
221239
222240
223
241
224242
225243
226244
......
242260
243261
244262
245
246263
247
248
264
265
266
249267
250268
251269
......
320338
321339
322340
323
341
324342
325343
326344
2 => array("pipe", "w"),
);
$this->proc = proc_open($cmd, $descriptors, $this->pipes);
$env = array("LANG" => "en_US.UTF-8");
$this->proc = proc_open($cmd, $descriptors, $this->pipes,
null, $env);
if (!is_resource($this->proc))
{
$version = fgets($this->pipes[1]);
if ($version === false)
{
$err = fgets($this->pipes[2]);
throw new IDF_Scm_Exception(
"Could not determine stdio version: $err"
"Could not determine stdio version, stderr is:\n".
$this->_readStderr()
);
}
}
/**
* Reads all output from stderr and returns it
*
* @return string
*/
private function _readStderr()
{
$err = "";
while (($line = fgets($this->pipes[2])) !== false)
{
$err .= $line;
}
return empty($err) ? "<empty>" : $err;
}
/**
* Reads the last output from the stdio process, parses and returns it
*
* @return string
* @throws IDF_Scm_Exception
*/
private function _read()
private function _readStdout()
{
$this->oob = array('w' => array(),
'p' => array(),
$c = fgetc($this->pipes[1]);
if ($c === false)
{
$err = fgets($this->pipes[2]);
throw new IDF_Scm_Exception(
"Could not read stdio: $err"
);
"No data on stdin, stderr is:\n".
$this->_readStderr()
);
}
if ($c == ':')
public function exec(array $args, array $options = array())
{
$this->_write($args, $options);
return $this->_read();
return $this->_readStdout();
}
/**

Archive Download the corresponding diff file

Page rendered in 0.08123s using 13 queries.