coderstephen/robo-ftp

This package is abandoned and no longer maintained. No replacement package was suggested.

FTP(S) task for Robo

v0.1.2 2015-02-16 16:33 UTC

This package is not auto-updated.

Last update: 2020-03-02 04:30:12 UTC


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.