mirror of
https://github.com/php/pecl-networking-ssh2.git
synced 2026-03-23 22:52:06 +01:00
1. php_ssh2_shell_open() was calling zend_hash_get_current_key_ex 2. php_ssh2_exec_command() / php_ssh2_shell_open() / php_ssh2_direct_tcpip() were being passed a pointer instead of the resource ID. 3. Renamed session_rsrc to session_rsrcid 3. Added test for ssh2_shell and reading / writing to the stream
24 lines
459 B
PHP
24 lines
459 B
PHP
--TEST--
|
|
ssh2_shell_test() - Tests opening a shell
|
|
--SKIPIF--
|
|
<?php require('ssh2_skip.inc'); ssh2t_needs_auth(); ?>
|
|
--FILE--
|
|
<?php require('ssh2_test.inc');
|
|
|
|
$ssh = ssh2_connect(TEST_SSH2_HOSTNAME, TEST_SSH2_PORT);
|
|
var_dump(ssh2t_auth($ssh));
|
|
$shell = ssh2_shell($ssh);
|
|
var_dump($shell);
|
|
|
|
fwrite( $shell, 'echo "foo bar"'.PHP_EOL);
|
|
sleep(1);
|
|
while($line = fgets($shell)) {
|
|
echo $line;
|
|
}
|
|
|
|
--EXPECTF--
|
|
bool(true)
|
|
resource(%d) of type (stream)
|
|
%a
|
|
foo bar
|
|
%a
|