开发者

svnlook through php gives one line

开发者 https://www.devze.com 2023-04-03 10:43 出处:网络
I have 开发者_StackOverflow中文版a simple php exec command that calls svnlook. If I run the command through the terminal I get all the output I expect. If I run it as shown below, I only get the last

I have 开发者_StackOverflow中文版a simple php exec command that calls svnlook. If I run the command through the terminal I get all the output I expect. If I run it as shown below, I only get the last item.

$list = exec("svnlook changed -r ".$urlCleaned." ".$SVNEXPORT); 
echo $list;

Can I buffer the output? If so how? And will that help?


That's by design and is explained:

string exec ( string $command [, array &$output [, int &$return_var ]] )

Return Values

The last line from the result of the command. If you need to execute a command and have all the data from the command passed directly back without any interference, use the passthru() function.

To get the output of the executed command, be sure to set and use the output parameter.

http://php.net/manual/en/function.exec.php

exec("svnlook changed -r ".$urlCleaned." ".$SVNEXPORT, $output);
var_dump($output);

Alternatively, shell_exec returns everything.

0

精彩评论

暂无评论...
验证码 换一张
取 消