avv/sftp-flybridge
最新稳定版本:v1.0.0
Composer 安装命令:
composer require avv/sftp-flybridge
包简介
A robust bridge to connect to SFTP servers using Flysystem v3.
README 文档
README
Effortlessly connect your PHP project with Flysystem SFTP using SFTP FLYBRIDGE. This package provides a seamless way to interact with remote SFTP servers, supporting both environment variables and manual configuration for maximum flexibility.
🚀 Features
✅ Simple Configuration – Use .env or pass an array with credentials.
✅ Secure & Fast – Built on Flysystem with best SFTP practices.
✅ Flexible & Extensible – Supports custom root paths, ports, and timeouts.
✅ PHP 8.1+ Compatibility – Modern, efficient, and optimized for performance.
📦 Installation
Install via Composer:
composer require avv/sftp-flybridge
⚙️ Configuration
You can configure SFTP FLYBRIDGE using environment variables or by passing an array to the constructor.
🔹 Option 1: Using .env
I recommend add your SFTP credentials to the .env file:
SFTP_HOST=sftp.example.com
SFTP_USERNAME=your_user
SFTP_PASSWORD=your_password
SFTP_PORT=22
SFTP_ROOT=/home/your_user/
SFTP_TIMEOUT=10
Then initialize the class:
use FlyBridge\SftpStorage;
$sftp = new SftpStorage();
🔹 Option 2: Passing Configuration Manually
$sftp = new SftpStorage([
'host' => 'sftp.example.com',
'username' => 'your_user',
'password' => 'your_password',
'port' => 22,
'root' => '/home/your_user/',
'timeout' => 10,
]);
📜 Usage Examples
Upload a File
$sftp->write('backup.sql', file_get_contents('local_backup.sql'));
Read a File
$content = $sftp->read('backup.sql');
echo $content;
Delete a File
$sftp->delete('backup.sql');
🧪 Testing
composer install
composer test
composer analyse
🤝 Contributing
See CONTRIBUTING.md for guidelines.
🎯 Why Choose SFTP FLYBRIDGE?
🚀 Easy Setup – Just install & configure!
🔒 Secure – Uses Flysystem’s best SFTP practices.
⚡ Optimized – Lightweight and fast.
📄 License
MIT License. Free to use and modify.
Made with ❤️ by AVV
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-03-26