bashanov/sftp-connector

通过curl或ssh2建立安全FTP(SFTP)连接的软件包。

安装: 9

依赖: 0

建议者: 0

安全: 0

星星: 0

关注者: 0

分支: 0

开放问题: 0

类型:项目

0.1 2019-06-17 12:59 UTC

This package is auto-updated.

Last update: 2024-09-18 01:36:29 UTC


README

该库帮助通过curl或ssh2建立SFTP连接并处理文件和文件夹。

安装

使用composer进行安装

composer require bashanov/sftp-connector

使用

创建SFTP连接有两种方式。

  1. 使用连接配置创建Factory实例。示例
/** Creating new connection and getting information about files and folders in current directory */
$sftp = SftpConnectorFactory::createConnection([
            'host' => 'test.website.com',
            'username' => 'login',
            'password' => 'password'
        ]);
print_r($sftp->ls('.'));  
  1. 创建扩展AbstractAdapter类的adapter并重写getConfig方法。您可以在仓库中找到示例文件,src/adapter/TestAdapter

注意事项

仅支持auth_noneauth_password方法。