array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'ja', ), 'this' => array ( 0 => 'function.ssh2-fetch-stream.php', 1 => 'ssh2_fetch_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' => 'ja', 'path' => 'reference/ssh2/functions/ssh2-fetch-stream.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL ssh2 >= 0.9.0)
ssh2_fetch_stream — 拡張データストリームを取得する
SSH2 チャネルストリームと関連付けられたサブストリームを取得します。
SSH2 プロトコルは現在ただ 1 つのサブストリーム STDERR
を定義しています。これはサブストリーム ID として
SSH2_STREAM_STDERR
(1 として定義)
を持ちます。
channel
streamid
SSH2 チャネルストリーム。
ストリームリソースを返します。
例1 シェルをオープンし、それと関連付けられた stderr ストリームを処理する
<?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);
?>