PhpseclibSftpTransfer
in package
implements
FileTransfer
FinalYes
Adapts phpseclib SFTP to the file transfer contracts using password authentication.
Tags
Table of Contents
Interfaces
- FileTransfer
- Defines file uploads and remote renaming without depending on a transport library.
Methods
- __construct() : mixed
- connect() : self
- rename() : void
- Renames a file on the remote server.
- uploadFile() : void
- Uploads a local file to the given remote path.
Methods
__construct()
public
__construct(SFTP $client, string $username, string $password, string $directory) : mixed
Parameters
- $client : SFTP
- $username : string
- $password : string
- $directory : string
connect()
public
static connect(string $host, int $port, string $username, string $password, string $directory) : self
Parameters
- $host : string
- $port : int
- $username : string
- $password : string
- $directory : string
Return values
selfrename()
Renames a file on the remote server.
public
rename(string $source, string $destination) : void
Parameters
- $source : string
-
Current remote path.
- $destination : string
-
New remote path.
uploadFile()
Uploads a local file to the given remote path.
public
uploadFile(string $localPath, string $remotePath) : void
Parameters
- $localPath : string
-
Path to the local file.
- $remotePath : string
-
Destination path on the remote server.