dennissmink/laravel-ftp 问题修复 & 功能扩展

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

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

dennissmink/laravel-ftp

最新稳定版本:1.0.75

Composer 安装命令:

composer require dennissmink/laravel-ftp

包简介

README 文档

README

Laravel FTP client (or any other project that utilises has composer)

This project is just called LaravelFtp because I am holding this package to the conventions Laravel itself uses, they are great and easy.

It also utilises the collection package, files are returned as collection so you can use the Collection functions from Laravel.

Usage

Installation

Require this package with composer:

composer require dennissmink/laravel-ftp dev-master

Usage

Initiate a new FTP client like so:

$ftp = ftp($host, $user, $pass, $optionalport);

Then, check if your connection was succesfull:

if(!$ftp){
    // Connection failed
    return 'Error while connecting to the FTP server';
}

// Do your stuff

Methods

General file functions

$ftp->all(); // Returns all the files of the users root files (Collection)
$ftp->all('folder'); // Returns all the files of the directory folder (Collection)

$ftp->get('filename.txt') // Returns the content of the file, can also be: get('directory/filename.txt')
$ftp->save('filename.txt', 'content file'); // Save file 'filename.txt' with content 'content file', returns content if success
$ftp->rename('oldname.txt', 'newname.txt'); // Renames file or directory

Create files/directories

$ftp->createFile('filename.txt'); // Creates a file with the name 'filename.txt'
$ftp->createDirectory('directory name'); // Creates a directory 'directory name'

Delete files/directories

$ftp->deleteFile('filename.txt'); // Deletes a file with the name 'filename.txt'
$ftp->deleteDirectory('directory name'); // Removes a directory with the name 'directory name' (And its contents..)
$ftp->emptyDirectory('directory name'); // Emptys a directory but keeps the directory itself

Links

Packagist: https://packagist.org/packages/dennissmink/laravel-ftp

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2016-01-16