note 72554 added to function.ssh2-fetch-stream
| From: | DennisK dot at osu1 dot php dot net | Date: | Wed, 24 Jan 2007 12:28:51 +0000 |
| Subject: | note 72554 added to function.ssh2-fetch-stream | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-122133@lists.php.net to get a copy of this message | ||
In addition to the last post from Ricardo Striquer:
Simple block the stream with stream_set_blocking(), and you dont have to sleep() the script...
<?php
stdout_stream = ssh2_exec($connection, "/bin/lssss -la /tmp");
$err_stream = ssh2_fetch_stream($stdout_stream, SSH2_STREAM_STDERR);
$dio_stream = ssh2_fetch_stream($stdout_stream, SSH2_STREAM_STDDIO);
stream_set_blocking($err_stream, true);
stream_set_blocking($dio_stream, true);
$result_err = stream_get_contents($err_stream));
$result_dio = stream_get_contents($dio_stream));
?>
----
Server IP: 212.124.37.9
Probable Submitter: 212.112.208.131
----
Manual Page -- http://www.php.net/manual/en/function.ssh2-fetch-stream.php
Edit -- https://master.php.net/note/edit/72554
Del: integrated -- https://master.php.net/note/delete/72554/integrated
Del: useless -- https://master.php.net/note/delete/72554/useless
Del: bad code -- https://master.php.net/note/delete/72554/bad+code
Del: spam -- https://master.php.net/note/delete/72554/spam
Del: non-english -- https://master.php.net/note/delete/72554/non-english
Del: in docs -- https://master.php.net/note/delete/72554/in+docs
Del: other reasons-- https://master.php.net/note/delete/72554
Reject -- https://master.php.net/note/reject/72554
Search -- https://master.php.net/manage/user-notes.php