承接 coercive/sftp 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

coercive/sftp

最新稳定版本:0.0.0

Composer 安装命令:

composer require coercive/sftp

包简介

Coercive SFTP

README 文档

README

SFTP utility for PHP

Get

composer require coercive/sftp

Dependencies

This package use ext-ssh2 : manual

Usage

Connect to FTP

use Coercive\Utility\SFTP\SFTP;

$SFtp = new SFTP('127.0 0.1', 22);
$SFtp->login('BestUser', 'BestPassword');
$SFtp->connect();

Disconnect

$SFtp->disconnect();

Create directory

$SFtp->mkdir('/example/dir/test');

List diretories and files

$data = $SFtp->list('/example/dir/test');

Upload file

$SFtp->upload('/README.md', '/example/dir/test/test.md');

Download file

$SFtp->download('/example/dir/test/test.md', '/test/dowloaded_file.md');

Download file : with auto tmp name and prefix

$SFtp->setTmpPrefix('_test_tmp_prefix_');
$SFtp->download('/example/dir/test/test.md', $filepath);

# do something with your file
rename($filepath, '/test/dowloaded_file.md');

Filesize

$integer = $SFtp->filesize('/example/dir/test/test.md');

Read file

$data = $SFtp->read('/example/dir/test/test.md');

Write into file

$SFtp->write('/example/dir/test/test.md', "# Hello World !\n");

Remove file

$SFtp->delete('/example/dir/test/test.md');

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-04-24