mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Document ssh2_exec() and ssh2_fetch_stream()
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@175977 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
742f0fddf0
commit
039d66a51b
2 changed files with 52 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.ssh2-exec">
|
||||
<refnamediv>
|
||||
|
@ -17,11 +17,31 @@
|
|||
<methodparam choice="opt"><type>array</type><parameter>env</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Execute a command at the remote end and allocate a channel for it.
|
||||
Returns a stream on success or &false; on failure.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
<example>
|
||||
<title>Executing a command</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$connection = ssh2_connect('shell.example.com', 22);
|
||||
ssh2_auth_password($connection, 'username', 'password');
|
||||
|
||||
$stream = ssh2_exec($connection, '/usr/local/bin/php -i');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>ssh2_connect</function>,
|
||||
<function>ssh2_shell</function>, and
|
||||
<function>ssh2_tunnel</function>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.ssh2-fetch-stream">
|
||||
<refnamediv>
|
||||
|
@ -16,9 +16,34 @@
|
|||
<methodparam><type>int</type><parameter>streamid</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
Fetch an alternate substream associated with an SSH2 channel stream.
|
||||
</para>
|
||||
<simpara>
|
||||
Fetches an alternate substream associated with an SSH2 channel stream
|
||||
identified by <parameter>streamid</parameter>. The SSH2 protocol
|
||||
currently defines only one substream, STDERR, which has a substream ID
|
||||
of <constant>SSH2_STREAM_STDERR</constant> (defined as 1).
|
||||
</simpara>
|
||||
|
||||
<example>
|
||||
<title>Opening a shell and retreiving the stderr stream associated with it.</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$connection = ssh2_connect('shell.example.com', 22);
|
||||
ssh2_auth_password($connection, 'username', 'password');
|
||||
|
||||
$stdio_stream = ssh2_shell($connection);
|
||||
$stderr_stream = ssh2_fetch_stream($stdio_stream, SSH2_STREAM_STDERR);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<simpara>
|
||||
See Also:
|
||||
<function>ssh2_shell</function>,
|
||||
<function>ssh2_exec</function>, and
|
||||
<function>ssh2_connect</function>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
Loading…
Reference in a new issue