reaway/think-filesystem-driver-sftp
最新稳定版本:v1.0.0
Composer 安装命令:
composer require reaway/think-filesystem-driver-sftp
包简介
thinkphp filesystem sftp driver
README 文档
README
安装
composer require reaway/think-filesystem-driver-sftp
用法
在config/filesystem.php添加配置
return [ 'default' => 'local', 'disks' => [ 'local' => [ 'type' => 'local', 'root' => app()->getRuntimePath() . 'storage', ], 'public' => [ 'type' => 'local', 'root' => app()->getRootPath() . 'public/storage', 'url' => '/storage', 'visibility' => 'public', ], // 添加配置 'sftp' => [ 'type' => 'sftp', 'root' => 'uploads', 'connection' => [ 'host' => '127.0.0.1', // 基于基础的身份验证设置... 'username' => 'username', 'password' => 'password', // 可选的 SFTP 设置 'port' => 22, ] ], ], ];
使用
use think\facade\Filesystem; $savename = Filesystem::disk('sftp')->putFile('topic', $file);
文档
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2025-07-02