From 1a42b3392298a348491bbe15da243ab454b3a786 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Mon, 19 Apr 2004 15:18:18 +0000 Subject: [PATCH] bash out some docs for pty support in proc-open git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@156573 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/exec/functions/proc-open.xml | 32 +++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) 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 +} +?> ]]>