Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

nowiko/SFTPBundle

Open more actions menu

Repository files navigation

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

About

Simple wrapper for standard PHP functions to transfer files via SFTP

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.