bashanov / sftp-connector
通过curl或ssh2建立安全FTP(SFTP)连接的软件包。
0.1
2019-06-17 12:59 UTC
Requires
- php: >=7.1
Requires (Dev)
- phpunit/phpunit: 6.*
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连接有两种方式。
- 使用连接配置创建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('.'));
- 创建扩展
AbstractAdapter类的adapter并重写getConfig方法。您可以在仓库中找到示例文件,src/adapter/TestAdapter。
注意事项
仅支持auth_none和auth_password方法。