定制 damijanc/simple-ftp 二次开发

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

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

damijanc/simple-ftp

最新稳定版本:2.0.0

Composer 安装命令:

composer require damijanc/simple-ftp

包简介

Simple FTP wrapper

README 文档

README

Build Status simple-ftp

Simple wrapper for PHP (http://php.net/manual/en/book.ftp.php) FTP

Motivation for this class was to simplify usage of FTP so instead of doing:

$conn = ftp_connect($host, $port, $timeout);
if ($conn) {
  $login_result = ftp_login($conn, $user, $password);
  if ($login_result) {
          $connected = TRUE;
  }
}

We simply do

use damijanc\FTP\Client;

$ftp = new Client($options);
$ftp->connect();

In addition we can use shell commands like:

cd  -change dir
put -upload a file
ls - list directory
get - download file

Example:

use damijanc\FTP\Client;

$options = array;
$options['server'] = 'ftp.example.com';
$options['port'] = 21;
$options['user'] = 'user';
$options['pass'] = 'password';

//connect to server
$ftp = new Client($options);
$ftp->connect();
//got to folder
$ftp->cd('Folder1');
//upload file
$ftp->put('file1.zip');
//list content
$ftp->ls();
//end session
$ftp->disconnect();

Installation:

composer require damijanc/simple-ftp

TODO:

  • add multiple file/folder upload
  • add upload/download progress display
  • fix code comments
  • ...

统计信息

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

GitHub 信息

  • Stars: 7
  • Watchers: 2
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2015-06-07