kisphp/php-sftp-client
Composer 安装命令:
composer require kisphp/php-sftp-client
包简介
Tiny PHP SFTP client
README 文档
README
Installation
Add in composer:
{
"require": {
"kisphp/php-sftp-client": "~0.1"
}
}
Usage
Create a config class that implements ConfigInterface
<?php use Kisphp\ConfigInterface; class Config implements ConfigInterface { public function getHost() { return '10.10.0.61'; } public function getPort() { return 22; } public function getUsername() { return 'vagrant'; } public function getPassword() { return 'vagrant'; } }
Instantiate SftpConnect class and pass your Config object to it
$s = new SftpConnect(new Config());
Upload a file
$s->sendFile(__DIR__ . '/source.php', 'b.php'); // will return true for success and false for failure
Download a file
$s->receiveFile('a.php', 'c.php'); // will return true for success and false for failure
统计信息
- 总下载量: 257
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-09-23