Extension for Yii2-Gftp allowing SFTP connection
Requirements ¶
This extensions requires :
- Yii2 framework
- phpseclib/phpseclib >= 0.3.10
- Yii2-Gftp extension >= 2.0
Usage ¶
This extension needs Yii2-Gftp extension to work and registers a new "FTP" driver using SFTP connection.
return [
// [...]
'components'=>[
// [...]
'ftp' => [
'class' => '\gftp\FtpComponent',
'connectionString' => 'sftp://user:pass@host:22',
'driverOptions' => [ 'timeout' => 120 ]
]
],
// [...]
];
or
return [
// [...]
'components'=>[
// [...]
'ftp' => [
'class' => '\gftp\FtpComponent',
'driverOptions' => [
'protocol' => \gftp\FtpProtocol::valueOf('sftp'),
'user' => 'me@somewhere.otrb',
'pass' => 'PassW0rd',
'host' => 'ssh.somewhere.otrb',
'port' => 22,
],
'timeout' => 120
]
],
// [...]
];
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.