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
This commit is contained in:
Wez Furlong 2004-04-19 15:18:18 +00:00
parent 186358848d
commit 1a42b33922

View file

@ -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>
@ -60,6 +60,36 @@ if (is_resource($process)) {
echo "command returned $return_value\n";
}
?>
]]>
</programlisting>
</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>