tofex/curl-ftp 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

tofex/curl-ftp

最新稳定版本:2.0.0

Composer 安装命令:

composer require tofex/curl-ftp

包简介

Tofex Curl FTP

README 文档

README

Tofex Curl FTP provides a client based on Curl.

Installation

$ composer require tofex/curl-ftp

License

Tofex Curl FTP is licensed under the MIT License - see the LICENSE file for details.

Usage

Creating a connection

$ftp = new Client();
$ftp->open([
    'host' => 'ftp.example.com',
    'user' => 'username',
    'password' => 'password',
    'port' => 990,
    'ssl' => true,
    'passive' => true,
    'timeout' => 30
]);

Alternatively you can create a connection using the connect() method

$ftp->connect($hostName, $port, $userName, $password, $useSsl, $usePassiveMode, $timeout);

Listing files

$files = $ftp->ls();

print_r($files);

produces

Array
(
    [0] => Array
        (
            [text] => file_1.zip
            [id] => /file_1.zip
        )

    [1] => Array
        (
            [text] => file_2.zip
            [id] => /file_2.zip
        )
)

Setting/changing current directory

$ftp->cd('directory/subdirectory');

Read file contents

$contents = $ftp->read('path/to/file.zip');

Write to file

$contents = 'file contents';
$ftp->write('path/to/file.txt', $contents);

Remove a file/directory

$ftp->rm('path/to/file.txt');

Catching errors

All exceptions are thrown as standard Exception classes with the following message format:

Could not handle content in path: {path} ({cURL error number})

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-04-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固