mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
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:
parent
186358848d
commit
1a42b33922
1 changed files with 31 additions and 1 deletions
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue