ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
Public Member Functions | |
__construct ($ssh) | |
Default Constructor. More... | |
put ($remote_file, $data, $mode=self::SOURCE_STRING, $callback=null) | |
Uploads a file to the SCP server. More... | |
get ($remote_file, $local_file=false) | |
Downloads a file from the SCP server. More... | |
_send ($data) | |
Sends a packet to an SSH server. More... | |
_receive () | |
Receives a packet from an SSH server. More... | |
_close () | |
Closes the connection to an SSH server. More... | |
Data Fields | |
const | SOURCE_LOCAL_FILE = 1 |
#+ public More... | |
const | SOURCE_STRING = 2 |
Reads data from a string. More... | |
const | MODE_SSH1 = 1 |
#- More... | |
const | MODE_SSH2 = 2 |
SSH2 is being used. More... | |
$ssh | |
$packet_size | |
$mode | |
phpseclib\Net\SCP::__construct | ( | $ssh | ) |
Default Constructor.
Connects to an SSH server
string | $host | |
int | $port | |
int | $timeout |
Definition at line 111 of file SCP.php.
References phpseclib\Net\SCP\$ssh.
phpseclib\Net\SCP::_close | ( | ) |
Closes the connection to an SSH server.
private
Definition at line 329 of file SCP.php.
References phpseclib\Net\SSH2\CHANNEL_EXEC.
Referenced by phpseclib\Net\SCP\get(), and phpseclib\Net\SCP\put().
phpseclib\Net\SCP::_receive | ( | ) |
Receives a packet from an SSH server.
Definition at line 294 of file SCP.php.
References $response, phpseclib\Net\SSH2\CHANNEL_EXEC, phpseclib\Net\SSH1\RESPONSE_DATA, and phpseclib\Net\SSH1\RESPONSE_TYPE.
Referenced by phpseclib\Net\SCP\get(), and phpseclib\Net\SCP\put().
phpseclib\Net\SCP::_send | ( | $data | ) |
Sends a packet to an SSH server.
string | $data | private |
Definition at line 276 of file SCP.php.
References $data, and phpseclib\Net\SSH2\CHANNEL_EXEC.
Referenced by phpseclib\Net\SCP\get(), and phpseclib\Net\SCP\put().
phpseclib\Net\SCP::get | ( | $remote_file, | |
$local_file = false |
|||
) |
Downloads a file from the SCP server.
Returns a string containing the contents of $remote_file if $local_file is left undefined or a boolean false if the operation was unsuccessful. If $local_file is defined, returns true or false depending on the success of the operation
string | $remote_file | |
string | $local_file |
Definition at line 220 of file SCP.php.
References $data, $info, $size, phpseclib\Net\SCP\_close(), phpseclib\Net\SCP\_receive(), and phpseclib\Net\SCP\_send().
phpseclib\Net\SCP::put | ( | $remote_file, | |
$data, | |||
$mode = self::SOURCE_STRING , |
|||
$callback = null |
|||
) |
Uploads a file to the SCP server.
By default, ::put() does not read from the local filesystem. $data is dumped directly into $remote_file. So, for example, if you set $data to 'filename.ext' and then do get(), you will get a file, twelve bytes long, containing 'filename.ext' as its contents.
Setting $mode to self::SOURCE_LOCAL_FILE will change the above behavior. With self::SOURCE_LOCAL_FILE, $remote_file will contain as many bytes as filename.ext does on your local filesystem. If your filename.ext is 1MB then that is how large $remote_file will be, as well.
Currently, only binary mode is supported. As such, if the line endings need to be adjusted, you will need to take care of that, yourself.
string | $remote_file | |
string | $data | |
int | $mode | |
callable | $callback |
Definition at line 146 of file SCP.php.
References $data, $size, phpseclib\Net\SCP\_close(), phpseclib\Net\SCP\_receive(), phpseclib\Net\SCP\_send(), and phpseclib\Net\SSH2\CHANNEL_EXEC.
phpseclib\Net\SCP::$ssh |
Definition at line 82 of file SCP.php.
Referenced by phpseclib\Net\SCP\__construct().
const phpseclib\Net\SCP::MODE_SSH1 = 1 |
const phpseclib\Net\SCP::SOURCE_LOCAL_FILE = 1 |
const phpseclib\Net\SCP::SOURCE_STRING = 2 |