PHP 클래스 phpseclib\Net\SCP

저자: Jim Wigginton ([email protected])
파일 보기 프로젝트 열기: phpseclib/phpseclib 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$mode integer Mode
$packet_size integer Packet Size
$ssh object SSH Object

공개 메소드들

메소드 설명
__construct ( SSH1 | SSH2 $ssh ) : SCP Default Constructor.
_close ( ) Closes the connection to an SSH server
_receive ( ) : string Receives a packet from an SSH server
_send ( string $data ) Sends a packet to an SSH server
get ( string $remote_file, string $local_file = false ) : mixed Downloads a file from the SCP server.
put ( string $remote_file, string $data, integer $mode = self::SOURCE_STRING, callable $callback = null ) : boolean Uploads a file to the SCP server.

메소드 상세

__construct() 공개 메소드

Connects to an SSH server
public __construct ( SSH1 | SSH2 $ssh ) : SCP
$ssh SSH1 | SSH2
리턴 SCP

_close() 공개 메소드

Closes the connection to an SSH server
public _close ( )

_receive() 공개 메소드

Receives a packet from an SSH server
public _receive ( ) : string
리턴 string

_send() 공개 메소드

Sends a packet to an SSH server
public _send ( string $data )
$data string

get() 공개 메소드

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
public get ( string $remote_file, string $local_file = false ) : mixed
$remote_file string
$local_file string
리턴 mixed

put() 공개 메소드

By default, \phpseclib\Net\SCP::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 \phpseclib\Net\SCP::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.
public put ( string $remote_file, string $data, integer $mode = self::SOURCE_STRING, callable $callback = null ) : boolean
$remote_file string
$data string
$mode integer
$callback callable
리턴 boolean

프로퍼티 상세

$mode 공개적으로 프로퍼티

Mode
public int $mode
리턴 integer

$packet_size 공개적으로 프로퍼티

Packet Size
public int $packet_size
리턴 integer

$ssh 공개적으로 프로퍼티

SSH Object
public object $ssh
리턴 object