From 1c96826f4bda53d204fd96ab69397f92dfae824f Mon Sep 17 00:00:00 2001 From: Mehdi Achour Date: Fri, 15 Jun 2007 00:16:47 +0000 Subject: [PATCH] ref.ssh2: new doc style git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@237706 c90b9560-bf6c-de11-be94-00142212c4b1 --- .../functions/ssh2-auth-hostbased-file.xml | 118 ++++- reference/ssh2/functions/ssh2-auth-none.xml | 68 ++- .../ssh2/functions/ssh2-auth-password.xml | 70 ++- .../ssh2/functions/ssh2-auth-pubkey-file.xml | 85 +++- reference/ssh2/functions/ssh2-connect.xml | 478 ++++++++++-------- reference/ssh2/functions/ssh2-exec.xml | 121 ++++- .../ssh2/functions/ssh2-fetch-stream.xml | 83 ++- reference/ssh2/functions/ssh2-fingerprint.xml | 77 ++- .../functions/ssh2-methods-negotiated.xml | 45 +- .../ssh2/functions/ssh2-publickey-add.xml | 4 +- .../ssh2/functions/ssh2-publickey-init.xml | 32 +- .../ssh2/functions/ssh2-publickey-list.xml | 15 +- .../ssh2/functions/ssh2-publickey-remove.xml | 14 +- reference/ssh2/functions/ssh2-scp-recv.xml | 64 ++- reference/ssh2/functions/ssh2-scp-send.xml | 96 +++- reference/ssh2/functions/ssh2-sftp-lstat.xml | 90 +++- reference/ssh2/functions/ssh2-sftp-mkdir.xml | 100 +++- .../ssh2/functions/ssh2-sftp-readlink.xml | 77 ++- .../ssh2/functions/ssh2-sftp-realpath.xml | 78 ++- reference/ssh2/functions/ssh2-sftp-rename.xml | 81 ++- reference/ssh2/functions/ssh2-sftp-rmdir.xml | 79 ++- reference/ssh2/functions/ssh2-sftp-stat.xml | 84 ++- .../ssh2/functions/ssh2-sftp-symlink.xml | 86 +++- reference/ssh2/functions/ssh2-sftp-unlink.xml | 74 ++- reference/ssh2/functions/ssh2-sftp.xml | 70 ++- reference/ssh2/functions/ssh2-shell.xml | 127 +++-- reference/ssh2/functions/ssh2-tunnel.xml | 86 +++- 27 files changed, 1741 insertions(+), 661 deletions(-) diff --git a/reference/ssh2/functions/ssh2-auth-hostbased-file.xml b/reference/ssh2/functions/ssh2-auth-hostbased-file.xml index 92523ec01b..426d21efe3 100644 --- a/reference/ssh2/functions/ssh2-auth-hostbased-file.xml +++ b/reference/ssh2/functions/ssh2-auth-hostbased-file.xml @@ -1,12 +1,13 @@ - + ssh2_auth_hostbased_file Authenticate using a public hostkey - - Description + + + &reftitle.description; boolssh2_auth_hostbased_file resourcesession @@ -17,17 +18,87 @@ stringpassphrase stringlocal_username + + Authenticate using a public hostkey read from a file. + + - - Authenticate using a public hostkey read from a file. If privkeyfile - is encrypted (which it should be), the passphrase must be provided. - If local_username is omitted, then the value for - username will be used for it. - + + &reftitle.parameters; + + + + session + + + An SSH connection link identifier, obtained from a call to + ssh2_connect. + + + + + username + + + + + + + hostname + + + + + + + pubkeyfile + + + + + + + privkeyfile + + + + + + + passphrase + + + If privkeyfile is encrypted (which it should + be), the passphrase must be provided. + + + + + local_username + + + If local_username is omitted, then the value + for username will be used for it. + + + + + + - - Authentication using a public hostkey - + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.examples; + + + Authentication using a public hostkey + 'ssh-rsa')); @@ -42,16 +113,21 @@ if (ssh2_auth_hostbased_file($connection, 'remoteusername', 'myhost.example.com' } ?> ]]> - - - - - - ssh2_auth_hostbased_file requires libssh2 >= 0.7 and PHP/SSH2 >= 0.7 - - - + + + + + + &reftitle.notes; + + + ssh2_auth_hostbased_file requires libssh2 >= 0.7 and + PHP/SSH2 >= 0.7 + + + + - + ssh2_auth_none Authenticate as "none" - - Description + + + &reftitle.description; mixedssh2_auth_none resourcesession stringusername - - + Attempt "none" authentication which usually will (and should) fail. As part of the failure, this function will return an array of accepted - authentication methods. If the server does accept "none" as an - authentication method for username, this function - will simply return &true;. - + authentication methods. + + - - Using <function>ssh2_auth_none</function> to retreive - a list of authentication methods. - + + &reftitle.parameters; + + + + session + + + An SSH connection link identifier, obtained from a call to + ssh2_connect. + + + + + username + + + Remote user name. + + + + + + + + + &reftitle.returnvalues; + + Returns &true; if the server doesc accept "none" as an authentication + method, or an array of accepted authentication methods on failure. + + + + + &reftitle.examples; + + + Retreiving a list of authentication methods + ]]> - - - + + + + - + ssh2_auth_password Authenticate over SSH using a plain password - - Description + + + &reftitle.description; boolssh2_auth_password resourcesession stringusername stringpassword - - + Authenticate over SSH using a plain password - + + - - Authenticating with a password - + + &reftitle.parameters; + + + + session + + + An SSH connection link identifier, obtained from a call to + ssh2_connect. + + + + + username + + + Remote user name. + + + + + password + + + Password for username + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.examples; + + + Authenticating with a password + ]]> - - - + + + + - + ssh2_auth_pubkey_file Authenticate using a public key - - Description + + + &reftitle.description; boolssh2_auth_pubkey_file resourcesession @@ -16,15 +16,71 @@ stringprivkeyfile stringpassphrase + + Authenticate using a public key read from a file. + + - - Authenticate using a public key read from a file. If privkeyfile - is encrypted (which it should be), the passphrase must be provided. - + + &reftitle.parameters; + + + + session + + + An SSH connection link identifier, obtained from a call to + ssh2_connect. + + + + + username + + + + + + + pubkeyfile + + + + + + + privkeyfile + + + + + + + passphrase + + + If privkeyfile is encrypted (which it should + be), the passphrase must be provided. + + + + + + - - Authentication using a public key - + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.examples; + + + Authentication using a public key + 'ssh-rsa')); @@ -38,10 +94,11 @@ if (ssh2_auth_pubkey_file($connection, 'username', } ?> ]]> - - - + + + + - + ssh2_connect Connect to an SSH server - - Description + + + &reftitle.description; resourcessh2_connect stringhost @@ -15,213 +15,252 @@ arraymethods arraycallbacks - - - Establish a connection to a remote SSH server and return a resource on success, &false; on error. - - - - methods may be an associative array with up to four parameters - as described below. - - - - <parameter>methods</parameter> may be an associative array - with any or all of the following parameters. - - - - Index - Meaning - Supported Values* - - - - - kex - - List of key exchange methods to advertise, comma separated - in order of preference. - - - diffie-hellman-group1-sha1, - diffie-hellman-group14-sha1, and - diffie-hellman-group-exchange-sha1 - - - - hostkey - - List of hostkey methods to advertise, come separated - in order of preference. - - - ssh-rsa and - ssh-dss - - - - client_to_server - - Associative array containing crypt, compression, and - message authentication code (MAC) method preferences - for messages sent from client to server. - - - - - server_to_client - - Associative array containing crypt, compression, and - message authentication code (MAC) method preferences - for messages sent from client to server. - - - - - -
+ Establish a connection to a remote SSH server.
- - - * - Supported Values are dependent on methods supported by underlying library. - See libssh2 documentation for additional - information. - - - - - <parameter>client_to_server</parameter> and - <parameter>server_to_client</parameter> may be an associative array - with any or all of the following parameters. - - - - - Index - Meaning - Supported Values* - - - - - crypt - List of crypto methods to advertise, comma separated - in order of preference. - - rijndael-cbc@lysator.liu.se, - aes256-cbc, - aes192-cbc, - aes128-cbc, - 3des-cbc, - blowfish-cbc, - cast128-cbc, - arcfour, and - none** - - - - comp - List of compression methods to advertise, comma separated - in order of preference. - - zlib and - none - - - - mac - List of MAC methods to advertise, come separated - in order of preference. - - hmac-sha1, - hmac-sha1-96, - hmac-ripemd160, - hmac-ripemd160@openssh.com, and - none** - - - - -
+ Once connected, the client should verify the server's hostkey using + ssh2_fingerprint, then authenticate using either + password or public key.
+
- - Crypt and MAC method "<literal>none</literal>" - - For security reasons, none is disabled by the underlying - libssh2 library unless explicitly enabled - during build time by using the appropriate ./configure options. See documentation - for the underlying library for more information. - - - + + &reftitle.parameters; - - <parameter>callbackss</parameter> may be an associative array - with any or all of the following parameters. - - - - Index - Meaning - Prototype - - - - - ignore - - Name of function to call when an - SSH2_MSG_IGNORE - packet is received - - void ignore_cb($message) - - - debug - - Name of function to call when an - SSH2_MSG_DEBUG - packet is received - - void debug_cb($message, $language, $always_display) - - - macerror - - Name of function to call when a - packet is received but the message authentication - code failed. If the callback returns &true;, - the mismatch will be ignored, otherwise the - connection will be terminated. - - bool macerror_cb($packet) - - - disconnect - - Name of function to call when an - SSH2_MSG_DISCONNECT - packet is received - - void disconnect_cb($reason, $message, $language) - - - -
+ + + host + + + + + + + port + + + + + + + methods + + + methods may be an associative array with up to four parameters + as described below. + + + + <parameter>methods</parameter> may be an associative array + with any or all of the following parameters. + + + + Index + Meaning + Supported Values* + + + + + kex + + List of key exchange methods to advertise, comma separated + in order of preference. + + + diffie-hellman-group1-sha1, + diffie-hellman-group14-sha1, and + diffie-hellman-group-exchange-sha1 + + + + hostkey + + List of hostkey methods to advertise, come separated + in order of preference. + + + ssh-rsa and + ssh-dss + + + + client_to_server + + Associative array containing crypt, compression, and + message authentication code (MAC) method preferences + for messages sent from client to server. + + + + + server_to_client + + Associative array containing crypt, compression, and + message authentication code (MAC) method preferences + for messages sent from client to server. + + + + + +
+
+ + * - Supported Values are dependent on methods supported by underlying library. + See libssh2 documentation for additional + information. + + + + + <parameter>client_to_server</parameter> and + <parameter>server_to_client</parameter> may be an associative array + with any or all of the following parameters. + + + + + Index + Meaning + Supported Values* + + + + + crypt + List of crypto methods to advertise, comma separated + in order of preference. + + rijndael-cbc@lysator.liu.se, + aes256-cbc, + aes192-cbc, + aes128-cbc, + 3des-cbc, + blowfish-cbc, + cast128-cbc, + arcfour, and + none** + + + + comp + List of compression methods to advertise, comma separated + in order of preference. + + zlib and + none + + + + mac + List of MAC methods to advertise, come separated + in order of preference. + + hmac-sha1, + hmac-sha1-96, + hmac-ripemd160, + hmac-ripemd160@openssh.com, and + none** + + + + +
+
+ + + Crypt and MAC method "<literal>none</literal>" + + For security reasons, none is disabled by the underlying + libssh2 library unless explicitly enabled + during build time by using the appropriate ./configure options. See documentation + for the underlying library for more information. + + + +
+
+ + callbacks + + + callbackss may be an associative array with any + or all of the following parameters. + + + + + Index + Meaning + Prototype + + + + + ignore + + Name of function to call when an + SSH2_MSG_IGNORE packet is received + + void ignore_cb($message) + + + debug + + Name of function to call when an + SSH2_MSG_DEBUG packet is received + + void debug_cb($message, $language, $always_display) + + + macerror + + Name of function to call when a packet is received but the + message authentication code failed. If the callback returns + &true;, the mismatch will be ignored, otherwise the connection + will be terminated. + + bool macerror_cb($packet) + + + disconnect + + Name of function to call when an + SSH2_MSG_DISCONNECT packet is received + + void disconnect_cb($reason, $message, $language) + + + +
+
+
+
+
+
- - - Open a connection forcing 3des-cbc when sending packets, - any strength aes cipher when receiving packets, - no compression in either direction, - and Group1 key exchange. - - + + &reftitle.returnvalues; + + Returns a resource on success, or &false; on error. + + + + + &reftitle.examples; + + + <function>ssh2_connect</function> example + + Open a connection forcing 3des-cbc when sending packets, any strength + aes cipher when receiving packets, no compression in either direction, + and Group1 key exchange. + + ]]> - - - - - Once connected, the client should verify the server's hostkey - using ssh2_fingerprint, then authenticate - using either password or public key. - - - - See Also: - ssh2_fingerprint, - ssh2_auth_none, - ssh2_auth_password, and - ssh2_auth_pubkey_file - - + + +
+ + + &reftitle.seealso; + + + ssh2_fingerprint + ssh2_auth_none + ssh2_auth_password + ssh2_auth_pubkey_file + + + +
- + ssh2_exec Execute a command on a remote server - - Description + + + &reftitle.description; resourcessh2_exec resourcesession @@ -18,15 +18,90 @@ intheight intwidth_height_type - - + Execute a command at the remote end and allocate a channel for it. - Returns a stream on success or &false; on failure. - + + - - Executing a command - + + &reftitle.parameters; + + + + session + + + An SSH connection link identifier, obtained from a call to + ssh2_connect. + + + + + command + + + + + + + pty + + + + + + + env + + + env may be passed as an associative array of + name/value pairs to set in the target environment. + + + + + width + + + Width of the virtual terminal. + + + + + height + + + Height of the virtual terminal. + + + + + width_height_type + + + width_height_type should be one of + SSH2_TERM_UNIT_CHARS or + SSH2_TERM_UNIT_PIXELS. + + + + + + + + + &reftitle.returnvalues; + + Returns a stream on success or &false; on failure. + + + + + &reftitle.examples; + + + Executing a command + ]]> - - - - - See Also: - ssh2_connect, - ssh2_shell, and - ssh2_tunnel - + + + + + + &reftitle.seealso; + + + ssh2_connect + ssh2_shell + ssh2_tunnel + + + + - + ssh2_fetch_stream Fetch an extended data stream - - Description + + + &reftitle.description; resourcessh2_fetch_stream resourcechannel intstreamid + + Fetches an alternate substream associated with an SSH2 channel stream. + The SSH2 protocol currently defines only one substream, STDERR, which has + a substream ID of SSH2_STREAM_STDERR (defined as 1). + + - - Fetches an alternate substream associated with an SSH2 channel stream - identified by streamid. The SSH2 protocol - currently defines only one substream, STDERR, which has a substream ID - of SSH2_STREAM_STDERR (defined as 1). - + + &reftitle.parameters; + + + + channel + + + + + + + streamid + + + An SSH2 channel stream. + + + + + + - - Opening a shell and retrieving the stderr stream associated with it. - + + &reftitle.returnvalues; + + Returns the requested stream resource. + + + + + &reftitle.examples; + + + Opening a shell and retrieving the stderr stream associated with it + ]]> - - - - - See Also: - ssh2_shell, - ssh2_exec, and - ssh2_connect - - + + + + + + &reftitle.seealso; + + + ssh2_shell + ssh2_exec + ssh2_connect + + + + - + ssh2_fingerprint Retreive fingerprint of remote server - - Description + + + &reftitle.description; stringssh2_fingerprint resourcesession intflags - - + Returns a server hostkey hash from an active session. - Defaults to MD5 fingerprint encoded as ASCII hex values. - + + - - flags may be either of - SSH2_FINGERPRINT_MD5 or - SSH2_FINGERPRINT_SHA1 logically ORed with - SSH2_FINGERPRINT_HEX or - SSH2_FINGERPRINT_RAW. - Defaults to SSH2_FINGERPRINT_MD5 | - SSH2_FINGERPRINT_HEX. - + + &reftitle.parameters; + + + + session + + + An SSH connection link identifier, obtained from a call to + ssh2_connect. + + + + + flags + + + flags may be either of + SSH2_FINGERPRINT_MD5 or + SSH2_FINGERPRINT_SHA1 logically ORed with + SSH2_FINGERPRINT_HEX or + SSH2_FINGERPRINT_RAW. + Defaults to SSH2_FINGERPRINT_MD5 | + SSH2_FINGERPRINT_HEX. + + + + + + - - Checking the fingerprint against a known value - + + &reftitle.returnvalues; + + Returns the hostkey hash as a string. + + + + + &reftitle.examples; + + + Checking the fingerprint against a known value + ]]> - - - + + + + - + ssh2_methods_negotiated Return list of negotiated methods - - Description + + + &reftitle.description; arrayssh2_methods_negotiated resourcesession - Returns list of negotiated methods. + + + &reftitle.parameters; + + + + session + + + An SSH connection link identifier, obtained from a call to + ssh2_connect. + + + + + + + + + &reftitle.returnvalues; + + + + + + + &reftitle.examples; Determining what methods were negotiated @@ -45,12 +71,15 @@ echo "\tMAC: {$methods['server_to_client']['mac']}\n"; + + + &reftitle.seealso; - See Also: - ssh2_connect + + ssh2_connect + - diff --git a/reference/ssh2/functions/ssh2-publickey-add.xml b/reference/ssh2/functions/ssh2-publickey-add.xml index 72a055077b..0fd4220971 100644 --- a/reference/ssh2/functions/ssh2-publickey-add.xml +++ b/reference/ssh2/functions/ssh2-publickey-add.xml @@ -1,6 +1,5 @@ - - + ssh2_publickey_add @@ -119,6 +118,7 @@ ssh2_publickey_add($ssh2, 'ssh-rsa', $keyblob, false, array('comment'=>"John's K + + ssh2_publickey_init @@ -24,19 +24,36 @@ If the remote server does not support the publickey subsystem, the ssh2_publickey_init function will return &false;. - - ¬e.ssh2.subsystem.publickey; - - + + + &reftitle.parameters; + + + + session + + + + + + + + + &reftitle.returnvalues; - Returns an SSH2 Publickey Subsystem - resource for use with all other ssh2_publickey_*() methods. + Returns an SSH2 Publickey Subsystem resource for use + with all other ssh2_publickey_*() methods, or &false on failure. + + &reftitle.notes; + ¬e.ssh2.subsystem.publickey; + + &reftitle.seealso; @@ -47,6 +64,7 @@ + - + ssh2_publickey_list @@ -15,9 +14,9 @@ arrayssh2_publickey_list resourcepkey - - ¬e.ssh2.subsystem.publickey; - + + List currently authorized publickeys. + @@ -123,6 +122,11 @@ Comment: Alice's Key + + &reftitle.notes; + ¬e.ssh2.subsystem.publickey; + + &reftitle.seealso; @@ -133,6 +137,7 @@ Comment: Alice's Key + - + ssh2_publickey_remove @@ -17,9 +16,9 @@ stringalgoname stringblob - - ¬e.ssh2.subsystem.publickey; - + + Removes an authorized publickey. + @@ -61,6 +60,11 @@ + + &reftitle.notes; + ¬e.ssh2.subsystem.publickey; + + &reftitle.seealso; diff --git a/reference/ssh2/functions/ssh2-scp-recv.xml b/reference/ssh2/functions/ssh2-scp-recv.xml index 4f7c9efbdd..f920d7ebc5 100644 --- a/reference/ssh2/functions/ssh2-scp-recv.xml +++ b/reference/ssh2/functions/ssh2-scp-recv.xml @@ -1,13 +1,13 @@ - - + ssh2_scp_recv Request a file via SCP - - Description + + + &reftitle.description; boolssh2_scp_recv resourcesession @@ -17,6 +17,50 @@ Copy a file from the remote server to the local filesystem using the SCP protocol. + + + + &reftitle.parameters; + + + + session + + + An SSH connection link identifier, obtained from a call to + ssh2_connect. + + + + + remote_file + + + Path to the remote file. + + + + + local_file + + + Path to the local file. + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.examples; Downloading a file via SCP @@ -32,12 +76,18 @@ ssh2_scp_recv($connection, '/remote/filename', '/local/filename'); + + + + &reftitle.seealso; - See Also: - ssh2_scp_send, and - copy + + ssh2_scp_send + copy + + - + ssh2_scp_send Send a file via SCP - - Description + + + &reftitle.description; boolssh2_scp_send resourcesession @@ -15,15 +15,66 @@ stringremote_file intcreate_mode - - + Copy a file from the local filesystem to the remote server using the SCP protocol. - The file will be created with the mode specified by create_mode. - + + - - Uploading a file via SCP - + + &reftitle.parameters; + + + + session + + + An SSH connection link identifier, obtained from a call to + ssh2_connect. + + + + + local_file + + + Path to the local file. + + + + + remote_file + + + Path to the remote file. + + + + + create_mode + + + The file will be created with the mode specified by + create_mode. + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.examples; + + + Uploading a file via SCP + ]]> - - - - - See Also: - ssh2_scp_recv, and - copy - - + + + + + + &reftitle.seealso; + + + ssh2_scp_recv + copy + + + + - + ssh2_sftp_lstat Stat a symbolic link - - Description + + + &reftitle.description; arrayssh2_sftp_lstat resourcesftp stringpath - - + Stats a symbolic link on the remote filesystem without - following the link. This function is similar to using the - lstat function with the - ssh2.sftp:// wrapper in PHP5 - and returns the same values. See the documentation for - stat for details on the values which may be returned. - + following the link. + + + This function is similar to using the lstat function + with the ssh2.sftp:// wrapper in PHP5 + and returns the same values. + + - - Stating a symbolic link via SFTP - + + &reftitle.parameters; + + + + sftp + + + + + + + path + + + Path to the remote symbolic link. + + + + + + + + + &reftitle.returnvalues; + + See the documentation for stat for details on the + values which may be returned. + + + + + &reftitle.examples; + + + Stating a symbolic link via SFTP + ]]> - - - - - See Also: - ssh2_sftp_stat, - lstat, and - stat - - + + + + + + &reftitle.seealso; + + + ssh2_sftp_stat + lstat + stat + + + + - + ssh2_sftp_mkdir Create a directory - - Description + + + &reftitle.description; boolssh2_sftp_mkdir resourcesftp @@ -15,19 +15,70 @@ intmode boolrecursive - - + Creates a directory on the remote file server with permissions set to - mode. If recursive is &true; - any parent directories required for dirname will - be automatically created as well. + mode. + + This function is similar to using mkdir with the ssh2.sftp:// wrapper. - + + - - Creating a directory on a remote server - + + &reftitle.parameters; + + + + sftp + + + An SSH2 SFTP resource opened by ssh2_sftp. + + + + + dirname + + + Path of the new directory. + + + + + mode + + + Permissions on the new directory. + + + + + recursive + + + If recursive is &true; any parent directories + required for dirname will be automatically created as well. + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.examples; + + + Creating a directory on a remote server + ]]> - - - - - See Also: - mkdir, and - ssh2_sftp_rmdir - - + + + + + + &reftitle.seealso; + + + mkdir + ssh2_sftp_rmdir + + + + - + ssh2_sftp_readlink Return the target of a symbolic link - - Description + + + &reftitle.description; stringssh2_sftp_readlink resourcesftp stringlink - - + Returns the target of a symbolic link. - + + - - Reading a symbolic link - + + &reftitle.parameters; + + + + sftp + + + An SSH2 SFTP resource opened by ssh2_sftp. + + + + + link + + + Path of the symbolic link. + + + + + + + + + &reftitle.returnvalues; + + Returns the target of the symbolic link. + + + + + &reftitle.examples; + + + Reading a symbolic link + ]]> - - - - - See Also: - readlink, and - ssh2_sftp_symlink - - + + + + + + &reftitle.seealso; + + + readlink + ssh2_sftp_symlink + + + + - + ssh2_sftp_realpath Resolve the realpath of a provided path string - - Description + + + &reftitle.description; stringssh2_sftp_realpath resourcesftp stringfilename - - + Translates filename into the effective real path on the remote filesystem. - + + - - Resolving a pathname - + + &reftitle.parameters; + + + + sftp + + + An SSH2 SFTP resource opened by ssh2_sftp. + + + + + filename + + + + + + + + + + + &reftitle.returnvalues; + + Returns the real path as a string. + + + + + &reftitle.examples; + + + Resolving a pathname + ]]> - - - - - See Also: - realpath, and - ssh2_sftp_symlink - ssh2_sftp_readlink - - + + + + + + &reftitle.seealso; + + + realpath + ssh2_sftp_symlink + ssh2_sftp_readlink + + + + - + ssh2_sftp_rename Rename a remote file - - Description + + + &reftitle.description; boolssh2_sftp_rename resourcesftp stringfrom stringto - - + Renames a file on the remote filesystem. - + + - - Renaming a file via sftp - + + &reftitle.parameters; + + + + sftp + + + An SSH2 SFTP resource opened by ssh2_sftp. + + + + + from + + + + + + + to + + + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.examples; + + + Renaming a file via sftp + ]]> - - - - - See Also: - rename - - + + + + + + &reftitle.seealso; + + + rename + + + + - + ssh2_sftp_rmdir Remove a directory - - Description + + + &reftitle.description; boolssh2_sftp_rmdir resourcesftp stringdirname - - + Removes a directory from the remote file server. + + This function is similar to using rmdir with the ssh2.sftp:// wrapper. - + + - - Removing a directory on a remote server - + + &reftitle.parameters; + + + + sftp + + + An SSH2 SFTP resource opened by ssh2_sftp. + + + + + dirname + + + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.examples; + + + Removing a directory on a remote server + ]]> - - - - - See Also: - rmdir, and - ssh2_sftp_mkdir - - - + + + + + + &reftitle.seealso; + + + rmdir + ssh2_sftp_mkdir + + + + - + ssh2_sftp_stat Stat a file on a remote filesystem - - Description + + + &reftitle.description; arrayssh2_sftp_stat resourcesftp stringpath - - + Stats a file on the remote filesystem following any symbolic links. + + This function is similar to using the stat function with the ssh2.sftp:// wrapper in PHP5 - and returns the same values. See the documentation for - stat for details on the values which may be returned. - + and returns the same values. + + - - Stating a file via SFTP - + + &reftitle.parameters; + + + + sftp + + + An SSH2 SFTP resource opened by ssh2_sftp. + + + + + path + + + + + + + + + + + &reftitle.returnvalues; + + See the documentation for stat for details on the + values which may be returned. + + + + + &reftitle.examples; + + + Stating a file via SFTP + ]]> - - - - - See Also: - ssh2_sftp_lstat, - lstat, and - stat - - + + + + + + &reftitle.seealso; + + + ssh2_sftp_lstat + lstat + stat + + + + - + ssh2_sftp_symlink Create a symlink - - Description + + + &reftitle.description; boolssh2_sftp_symlink resourcesftp stringtarget stringlink + + Creates a symbolic link named link on the remote + filesystem pointing to target. + + - - Creates a symbolic link named link on the remote filesystem - pointing to target. - + + &reftitle.parameters; + + + + sftp + + + An SSH2 SFTP resource opened by ssh2_sftp. + + + + + target + + + Target of the symbolic link. + + + + + link + + + + + + + + - - Creating a symbolic link - + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.examples; + + + Creating a symbolic link + ]]> - - - - - See Also: - symlink, and - ssh2_sftp_readlink - - + + + + + + &reftitle.seealso; + + + ssh2_sftp_readlink + symlink + + + + - + ssh2_sftp_unlink Delete a file - - Description + + + &reftitle.description; boolssh2_sftp_unlink resourcesftp stringfilename + + Deletes a file on the remote filesystem. + + - - Deletes a file on the remote filesystem - + + &reftitle.parameters; + + + + sftp + + + An SSH2 SFTP resource opened by ssh2_sftp. + + + + + filename + + + + + + + + - - Deleting a file - + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.examples; + + + Deleting a file + ]]> - - - - - See Also: - unlink - - + + + + + + &reftitle.seealso; + + + unlink + + + + - + ssh2_sftp Initialize SFTP subsystem - - Description + + + &reftitle.description; resourcessh2_sftp resourcesession - - + Request the SFTP subsystem from an already connected SSH2 server. - + + - + + &reftitle.parameters; + + + + session + + + An SSH connection link identifier, obtained from a call to + ssh2_connect. + + + + + + + + + &reftitle.returnvalues; + This method returns an SSH2 SFTP resource for use with all other ssh2_sftp_*() methods and the ssh2.sftp:// fopen wrapper. - + + - - Opening a file via SFTP - + + &reftitle.examples; + + + Opening a file via SFTP + ]]> - - - - - See Also: - ssh2_scp_send, and - ssh2_scp_recv - - + + + + + + &reftitle.seealso; + + + ssh2_scp_recv + ssh2_scp_send + + + + - + ssh2_shell Request an interactive shell - - Description + + + &reftitle.description; resourcessh2_shell resourcesession @@ -17,26 +17,86 @@ intheight intwidth_height_type - - + Open a shell at the remote end and allocate a stream for it. - term_type should correspond to one of the entries - in the target system's /etc/termcap file and defaults to vanilla. - env may be passed as an associative array of name/value pairs - to set in the target environment. - + + - - width, and height - define the width and height of the virtual terminal allocated for the shell process. - width_height_type should be one of - SSH2_TERM_UNIT_CHARS or - SSH2_TERM_UNIT_PIXELS. - + + &reftitle.parameters; + + + + session + + + An SSH connection link identifier, obtained from a call to + ssh2_connect. + + + + + term_type + + + term_type should correspond to one of the + entries in the target system's /etc/termcap file + and defaults to vanilla. + + + + + env + + + env may be passed as an associative array of + name/value pairs to set in the target environment. + + + + + width + + + Width of the virtual terminal. + + + + + height + + + Height of the virtual terminal. + + + + + width_height_type + + + width_height_type should be one of + SSH2_TERM_UNIT_CHARS or + SSH2_TERM_UNIT_PIXELS. + + + + + + - - Executing a command - + + &reftitle.returnvalues; + + + + + + + &reftitle.examples; + + + Executing a command + ]]> - - - - - See Also: - ssh2_exec, - ssh2_tunnel, and - ssh2_fetch_stream - - + + + + + + &reftitle.seealso; + + + ssh2_exec + ssh2_tunnel + ssh2_fetch_stream + + + + - + ssh2_tunnel Open a tunnel through a remote server - - Description + + + &reftitle.description; resourcessh2_tunnel resourcesession stringhost intport + + Open a socket stream to an arbitrary host/port by way of the currently + connected SSH server. + + - - Open a socket stream to an arbitrary host/port by way of the - currently connected SSH server. - + + &reftitle.parameters; + + + + session + + + An SSH connection link identifier, obtained from a call to + ssh2_connect. + + + + + host + + + + + + + port + + + + + + + + - - Opening a tunnel to an arbitrary host - + + &reftitle.returnvalues; + + + + + + + &reftitle.examples; + + + Opening a tunnel to an arbitrary host + ]]> - - - - - See Also: - ssh2_connect, and - fsockopen - - + + + + + + &reftitle.seealso; + + + ssh2_connect + fsockopen + + + +