sunxyw/flysystem-sftp

Flysystem 的 SFTP 适配器

2.0.2 2020-12-02 13:23 UTC

README

Author Build Status Coverage Status Quality Score Software License Packagist Version Total Downloads Documentation

此适配器使用 phpseclib 提供Flysystem的SFTP适配器。

安装

composer require league/flysystem-sftp

文档

此适配器的完整文档可以在以下位置找到:这里https://flysystem.thephpleague.com/adapter/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',
    'passphrase' => 'passphrase-for-privateKey',
    'root' => '/path/to/root',
    'timeout' => 10,
    'directoryPerm' => 0755
]);

$filesystem = new Filesystem($adapter);