PHP SVN更新 - TortoiseSVN

New code:

<?php
exec('"C:\Program Files\TortoiseSVN\bin\svn.exe" update "c:\wamp\www\project"');

This results in an infinite loop, no result is returned. What am I doing wrong?

== edit ==

On Windows, I'm trying to update a project by using PHP. I'm having problems using the commandline: I want visual feedback (important in case of conflicts), so I don't want to start as a background process. Is this possible?

The code I have so far is:

<?php
$todo = "cd \"C:\\Program Files\\TortoiseSVN\\bin\\\"";
$todo2 = "START TortoiseProc.exe /command:update /path:\"C:\\wamp\\www\\project\\\" /closeonend:0";

 pclose(popen($todo, "r"));  
 pclose(popen($todo2, "r"));  

I would drop exec and use proc_open (see http://php.net/manual/en/function.proc-open.php)

Here's an example I quickly whipped up and which should work for you:

<?php
// setup pipes that you'll use
$descriptorspec = array(
    0 => array("pipe", "r"),    // stdin
    1 => array("pipe", "w"),    // stdout
    2 => array("pipe", "w")     // stderr
);

// call your process
$process = proc_open('"C:\Program Files\TortoiseSVN\bin\svn.exe" update "c:\wamp\www\project"',
                     $descriptorspec,
                     $pipes);

// if process is called, pipe data to variables which can later be processed.
if(is_resource($process)) 
{
    $stdin = stream_get_contents($pipes[0]);
    $stdout = stream_get_contents($pipes[1]);
    $stderr = stream_get_contents($pipes[2]);
    fclose($pipes[0]);  
    fclose($pipes[1]);  
    fclose($pipes[2]);
    $return_value = proc_close($process);   
}

// Now it's up to you what you want to do with the data you've got.
// Remember that this is merely an example, you'll probably want to 
// modify the output handling to your own likings...

header('Content-Type: text/plain; charset=UTF-8');  

// check if there was an error, if not - dump the data
if($return_value === -1)    
{
    echo('The termination status of the process indicates an error.'."
");
}

echo('---------------------------------'."
".'STDIN contains:'."
");
echo($stdin);
echo('---------------------------------'."
".'STDOUTcontains:'."
");
echo($stdout);
echo('---------------------------------'."
".'STDERR contains:'."
");
echo($stderr);

?>

Aside:

The line

// call your process
$process = proc_open('"C:\Program Files\TortoiseSVN\bin\svn.exe" update "c:\wamp\www\project"',
                     $descriptorspec,
                     $pipes);

could also be escaped like this

// call your process
$process = proc_open("\"C:\\Program Files\\TortoiseSVN\\bin\\svn.exe\" update \"c:\\wamp\\www\\project\"",
                     $descriptorspec,
                     $pipes);

which might or might not solve some problems on some systems that have hickups with the single brackets (') and spaces () in the notation.