sf2h/sftp-bundle

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

This bundle provide quite simple functions for interact with SFTP servers

Installs: 71 330

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 1

Forks: 3

Open Issues: 0

Type:symfony-bundle

v1.1 2020-12-20 23:14 UTC

This package is auto-updated.

Last update: 2021-10-10 11:41:51 UTC


README

SensioLabsInsight Scrutinizer Code Quality Build Status Maintainability

SFTP Bundle

This bundle provides a simple interface for transfer files by SFTP protocol.

Installation

  1. Install the bundle using Composer:
 composer require nw/sftp-bundle
  1. Enable bundle in AppKernel.php
class AppKernel extends Kernel
{
  public function registerBundles()
  {
      return array(
          // ... other bundles
          new NW\SFTPBundle\NWSFTPBundle()
       );
   }
}

Usage

  1. Connect to the SFTP server:
   $sftp = $this->get('nw.sftp');
   $sftp->connect($host, $port);
   $sftp->login($username, $password);
   // or
   $sftp->loginWithKey($host, $username, $pubkeyfile, $privkeyfile, $passphrase = null);
  1. Use SFTP client to transfer files:
    $sftp->fetch('/path/to/remoteFile', '/path/to/localFile');
    // or
    $sftp->send('/path/to/localFile', '/path/to/remoteFile');
  1. From CLI could be used one of the following commands:
app/console nw:sftp:fetch /path/to/remoteFile /path/to/localFile # - copy files from a remote server to the local machine
# or
app/console nw:sftp:send /path/to/localFile /path/to/remoteFile # - copy files from a local machine to the remote server