array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'ru', ), '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' => 'ru', '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 определяет только один подпоток STDERR,
имеющий идентификатор 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);
?>