Giter VIP home page Giter VIP logo

robo-ftp's Introduction

Robo FTP Deploy Task

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.

robo-ftp's People

Contributors

sagebind avatar

Watchers

James Cloos avatar Mallory Allen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.