<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.ssh2.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'function.ssh2-fetch-stream.php',
    1 => 'ssh2_fetch_stream',
    2 => 'Fetch an extended data stream',
  ),
  'up' => 
  array (
    0 => 'ref.ssh2.php',
    1 => 'SSH2 函数',
  ),
  'prev' => 
  array (
    0 => 'function.ssh2-exec.php',
    1 => 'ssh2_exec',
  ),
  'next' => 
  array (
    0 => 'function.ssh2-fingerprint.php',
    1 => 'ssh2_fingerprint',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/ssh2/functions/ssh2-fetch-stream.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.ssh2-fetch-stream" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ssh2_fetch_stream</h1>
  <p class="verinfo">(PECL ssh2 &gt;= 0.9.0)</p><p class="refpurpose"><span class="refname">ssh2_fetch_stream</span> &mdash; <span class="dc-title">Fetch an extended data stream</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.ssh2-fetch-stream-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>ssh2_fetch_stream</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$channel</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$streamid</code></span>): <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span></div>

  <p class="simpara">
   Fetches an alternate substream associated with an SSH2 channel stream.
   The SSH2 protocol currently defines only one substream, STDERR, which has
   a substream ID of <strong><code><a href="ssh2.constants.php#constant.ssh2-stream-stderr">SSH2_STREAM_STDERR</a></code></strong> (defined as 1).
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.ssh2-fetch-stream-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt><code class="parameter">channel</code></dt>
    <dd>
     <span class="simpara">
     </span>
    </dd>
   
   
    <dt><code class="parameter">streamid</code></dt>
    <dd>
     <span class="simpara">
      An SSH2 channel stream.
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.ssh2-fetch-stream-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="simpara">
   Returns the requested stream resource.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.ssh2-fetch-stream-examples">
  <h3 class="title">示例</h3>
  <div class="example" id="example-1">
   <p><strong>示例 #1 Opening a shell and retrieving the stderr stream associated with it</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$connection </span><span style="color: #007700">= </span><span style="color: #0000BB">ssh2_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">'shell.example.com'</span><span style="color: #007700">, </span><span style="color: #0000BB">22</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">ssh2_auth_password</span><span style="color: #007700">(</span><span style="color: #0000BB">$connection</span><span style="color: #007700">, </span><span style="color: #DD0000">'username'</span><span style="color: #007700">, </span><span style="color: #DD0000">'password'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$stdio_stream </span><span style="color: #007700">= </span><span style="color: #0000BB">ssh2_shell</span><span style="color: #007700">(</span><span style="color: #0000BB">$connection</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$stderr_stream </span><span style="color: #007700">= </span><span style="color: #0000BB">ssh2_fetch_stream</span><span style="color: #007700">(</span><span style="color: #0000BB">$stdio_stream</span><span style="color: #007700">, </span><span style="color: #0000BB">SSH2_STREAM_STDERR</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.ssh2-fetch-stream-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.ssh2-shell.php" class="function" rel="rdfs-seeAlso">ssh2_shell()</a> - Request an interactive shell</span></li>
   <li><span class="function"><a href="function.ssh2-exec.php" class="function" rel="rdfs-seeAlso">ssh2_exec()</a> - Execute a command on a remote server</span></li>
   <li><span class="function"><a href="function.ssh2-connect.php" class="function" rel="rdfs-seeAlso">ssh2_connect()</a> - Connect to an SSH server</span></li>
  </ul>
 </div>


</div><?php manual_footer($setup); ?>