lc5/ftp 问题修复 & 功能扩展

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

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

lc5/ftp

最新稳定版本:1.1.1

Composer 安装命令:

composer require lc5/ftp

包简介

A simple object wrapper around native ftp_* functions.

关键字:

README 文档

README

A simple object wrapper around native ftp_* functions. Fully unit-tested.

Installation

Use Composer to install the package:

$ composer require lc5/ftp

Usage

use Lc5\Ftp\Ftp;

try {
    $ftp = new Ftp('ftp.example.com', 'username', 'password');

    //Save remote.txt to local.txt
    $ftp->get('local.txt', 'remote.txt', FTP_ASCII);

    //Actually you don't have to explicitly call close()
    //It will get called automatically as a part of the __destruct() method
    $ftp->close();

    //For anonymous login you only need to pass the host address
    $ftp = new Ftp('ftp.example.com');
    $ftp->pasv(true);

    //Get list of files in current directory and print them
    $files = $ftp->rawlist('.');

    foreach ($files as $file) {
        echo $file . PHP_EOL;
    }
} catch (\Exception $e) {
    echo $e->getMessage();
}

Extending

use Lc5\Ftp\Ftp;

class MyFtp extends Ftp
{
    public function myFunction()
    {
        $connection = $this->connect();
        
        //your custom code...
    }
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-11-25