pollita         Wed Dec 29 23:24:05 2004 EDT

  Modified files:              
    /phpdoc/en/reference/ssh2/functions ssh2-exec.xml 
                                        ssh2-fetch-stream.xml 
  Log:
  Document ssh2_exec() and ssh2_fetch_stream()
  
http://cvs.php.net/diff.php/phpdoc/en/reference/ssh2/functions/ssh2-exec.xml?r1=1.2&r2=1.3&ty=u
Index: phpdoc/en/reference/ssh2/functions/ssh2-exec.xml
diff -u phpdoc/en/reference/ssh2/functions/ssh2-exec.xml:1.2 
phpdoc/en/reference/ssh2/functions/ssh2-exec.xml:1.3
--- phpdoc/en/reference/ssh2/functions/ssh2-exec.xml:1.2        Wed Dec 29 
11:06:16 2004
+++ phpdoc/en/reference/ssh2/functions/ssh2-exec.xml    Wed Dec 29 23:24:05 2004
@@ -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>
 
http://cvs.php.net/diff.php/phpdoc/en/reference/ssh2/functions/ssh2-fetch-stream.xml?r1=1.1&r2=1.2&ty=u
Index: phpdoc/en/reference/ssh2/functions/ssh2-fetch-stream.xml
diff -u phpdoc/en/reference/ssh2/functions/ssh2-fetch-stream.xml:1.1 
phpdoc/en/reference/ssh2/functions/ssh2-fetch-stream.xml:1.2
--- phpdoc/en/reference/ssh2/functions/ssh2-fetch-stream.xml:1.1        Fri Dec 
24 20:03:17 2004
+++ phpdoc/en/reference/ssh2/functions/ssh2-fetch-stream.xml    Wed Dec 29 
23:24:05 2004
@@ -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>


Reply via email to