diff --git a/reference/exec/functions/proc-open.xml b/reference/exec/functions/proc-open.xml index 75e094157e..4a605d869c 100644 --- a/reference/exec/functions/proc-open.xml +++ b/reference/exec/functions/proc-open.xml @@ -1,5 +1,5 @@ - + @@ -60,6 +60,36 @@ if (is_resource($process)) { echo "command returned $return_value\n"; } ?> +]]> + + + + + PHP 5RC2 introduces pty support for systems with Unix98 ptys. This allows + your script to interact with applications that expect to be talking to a + terminal. A pty works like a pipe, but is bi-directional, so there is no + need to specify a read/write mode. The example below shows how to use a + pty; note that you don't have to have all descriptors talking to a pty. + Also note that only one pty is created, even though pty is specified 3 + times. In a future version of PHP, it might be possible to do more than + just read and write to the pty. + + + + + array("pty"), + 1 => array("pty"), + 2 => array("pty") +); +$process = proc_open("cvs -d:pserver:cvsread@cvs.php.net:/repository login", $descriptorspec, $pipes); +if (is_resource($process)) { + // work with it here +} +?> ]]>