定制 lodev09/php-ssh2 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

lodev09/php-ssh2

最新稳定版本:1.1.0

Composer 安装命令:

composer require lodev09/php-ssh2

包简介

Wrapper class for PHP's SSH2 extension.

README 文档

README

Wrapper class for PHP's SSH2 extension. The base class was created by Jamie Munro taken from this article.

Installation

$ composer require lodev09/php-ssh2

Usage

// connect
$auth = new \SSH2\Password(SFTP_USER, SFTP_PASSWORD);
$sftp = new \SSH2\SFTP(SFTP_HOST, $auth);

if ($sftp->is_connected() && $sftp->is_authenticated()) {
    // upload
    $sftp->put('/path/to/my/local/file', '/remote/file');

    // download
    $sftp->get('/remote/file', '/local/destination/file');
}

SFTP

Common helper methods includes:

  • SFTP::mv - move remote file
  • SFTP::rm - delete remote file
  • SFTP::list - list remote files
  • SFTP::is_dir - check if path is a directory
  • SFTP::exists - check if path exists

Other native methods can be called as well for example:

// ssh2_sftp_mkdir
$sftp->mkdir(...);

SCP

Just a pure wrapper of the native ssh2_scp_xxx functions.

// ssh2_scp_recv
$scp->recv(...);

Feedback

All bugs, feature requests, pull requests, feedback, etc., are welcome. Visit my site at www.lodev09.com or email me at lodev09@gmail.com

Credits

License

Released under the MIT License. See LICENSE file.

统计信息

  • 总下载量: 2.32k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-10-05