cvs: phpdoc /en/reference/exec/functions proc-open.xml

From: Date: Mon, 19 Apr 2004 15:18:18 +0000
Subject: cvs: phpdoc /en/reference/exec/functions proc-open.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969360185@lists.php.net to get a copy of this message
wez Mon Apr 19 11:18:18 2004 EDT Modified files: /phpdoc/en/reference/exec/functions proc-open.xml Log: bash out some docs for pty support in proc-open http://cvs.php.net/diff.php/phpdoc/en/reference/exec/functions/proc-open.xml?r1=1.7&r2=1.8&ty=u Index: phpdoc/en/reference/exec/functions/proc-open.xml diff -u phpdoc/en/reference/exec/functions/proc-open.xml:1.7 phpdoc/en/reference/exec/functions/proc-open.xml:1.8 --- phpdoc/en/reference/exec/functions/proc-open.xml:1.7 Wed Dec 17 09:32:10 2003 +++ phpdoc/en/reference/exec/functions/proc-open.xml Mon Apr 19 11:18:18 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> +<!-- $Revision: 1.8 $ --> <!-- splitted from ./en/functions/exec.xml, last change in rev 1.28 --> <refentry id='function.proc-open'> <refnamediv> @@ -65,6 +65,36 @@ </informalexample> </para> <para> + 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. + </para> + <para> + <informalexample> + <programlisting role="php"> +<![CDATA[ +<?php +// Create a psuedo terminal for the child process +$descriptorspec = array( + 0 => 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 +} +?> +]]> + </programlisting> + </informalexample> + </para> + <para> The file descriptor numbers in <parameter>descriptorspec</parameter> are not limited to 0, 1 and 2 - you may specify any valid file descriptor number and it will be passed to the child process. This allows your

« previous php.doc (#969360185) next »