thomasgenster / flysystem-sftp
SFTP 的 Flysystem 适配器
1.0.12
2016-10-17 23:19 UTC
Requires
- php: >=5.4.0
- league/flysystem: ~1.0
- phpseclib/phpseclib: ~2.0
Requires (Dev)
- mockery/mockery: 0.9.*
- phpunit/phpunit: ~4.0
README
此适配器使用 phpseclib 提供Flysystem的SFTP适配器。
安装
composer require league/flysystem-sftp
使用
use League\Flysystem\Sftp\SftpAdapter; use League\Flysystem\Filesystem; $adapter = new SftpAdapter([ 'host' => 'example.com', 'port' => 22, 'username' => 'username', 'password' => 'password', 'privateKey' => 'path/to/or/contents/of/privatekey', 'root' => '/path/to/root', 'timeout' => 10, 'agent' => true, 'directoryPerm' => 0755 ]); $filesystem = new Filesystem($adapter);