定制 coderstephen/robo-ftp 二次开发

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

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

coderstephen/robo-ftp

最新稳定版本:v0.1.2

Composer 安装命令:

composer require coderstephen/robo-ftp

包简介

FTP(S) task for Robo

README 文档

README

Version License Downloads

A simple task for the Robo task runner for deploying files to a remote server using FTP. Useful for shared hosting servers if you do not have SSH access, or for if you need better platform independence.

Installation

Add the package to your list of dependencies:

composer require --dev coderstephen/robo-ftp

This task uses dg/ftp-php for establishing FTP connections, which is a thin wrapper around the built-in FTP PHP extension. Most PHP installations are compiled with this extension, so this task should be able to be run just about anywhere with a PHP interpreter.

Usage

Just include the FtpDepoly trait in your RoboFile.php file and run an FTP deploy task using $this->taskFtpDeploy().

class RoboFile extends \Robo\Tasks
{
    use RoboFtp\FtpDeploy;

    function deploy()
    {
        $ftp = $this->taskFtpDeploy('host', 'user', 'password')
            ->dir('/')
            ->from('.')
            ->exclude('build')
            ->exclude('cache')
            ->skipSizeEqual()
            ->skipUnmodified()
            ->run();
    }
}

SSL Support

This task supports using FTP over SSL by default. You need the SSL extension for this to work, which isn't always available on Windows. If you want to disable SSL for your task, you can use the secure() method:

class RoboFile extends \Robo\Tasks
{
    use RoboFtp\FtpDeploy;

    function deploy()
    {
        $ftp = $this->taskFtpDeploy('host', 'user', 'password')
            ->dir('wwwroot')
            ->from('public')
            ->secure(false)
            ->run();
    }
}

Note that some Windows servers do not properly support FTP/S either and may error out when uploading files over SSL. Microsoft has made available a hotfix for this bug, but isn't distributed by default. More information here.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-02-01