This test case executes `cat` and uses `PHP_EOL` as line ending. This
causes the test to fail when executed on Windows connected to a Linux
SSH server. Since `cat` is usually not available on Windows, running
the test would fail if a Windows SSH server was used. Thus, we can
easily fix this by always using LF.
If the SSH2 Session resource has already been closed, the libssh2
session has been as well, and the `LIBSSH2_SESSION*` has been set NULL.
If that is the case, we must not call `libssh2_sftp_shutdown()`.
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
Since these all need a test ssh server to connect to,
you'll need to set some environment variables.
TEST_SSH2_HOSTNAME - Where to connect to
TEST_SSH2_PORT - Port (default: 22)
TEST_SSH2_USER - Login as (default: getenv('USER'))
TEST_SSH2_AUTH - Mode of authentication ('none', 'password', 'agent')
TEST_SSH2_PASS - Password to authenticate with
TEST_SSH2_TEMPDIR - Where to store temporary files on the remote filesystem
(default: /tmp )