Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nowiko/sftpbundle
Simple wrapper for standard PHP functions to transfer files via SFTP
https://github.com/nowiko/sftpbundle
sftp ssh symfony symfony-bundle transfer-files
Last synced: about 1 month ago
JSON representation
Simple wrapper for standard PHP functions to transfer files via SFTP
- Host: GitHub
- URL: https://github.com/nowiko/sftpbundle
- Owner: nowiko
- License: mit
- Created: 2015-11-29T11:52:15.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2021-10-10T11:43:12.000Z (about 3 years ago)
- Last Synced: 2024-10-01T15:27:58.566Z (about 2 months ago)
- Topics: sftp, ssh, symfony, symfony-bundle, transfer-files
- Language: PHP
- Homepage:
- Size: 369 KB
- Stars: 4
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/e0b26b60-76f3-40a4-9416-9b6c65fb93a2/mini.png)](https://insight.sensiolabs.com/projects/e0b26b60-76f3-40a4-9416-9b6c65fb93a2) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/NovikovViktor/SFTPBundle/badges/quality-score.png?b=develop)](https://scrutinizer-ci.com/g/NovikovViktor/SFTPBundle/?branch=develop) [![Build Status](https://travis-ci.org/nowiko/SFTPBundle.svg?branch=master)](https://travis-ci.org/nowiko/SFTPBundle) [![Maintainability](https://api.codeclimate.com/v1/badges/72c8963111d07dacf0c6/maintainability)](https://codeclimate.com/github/NovikovViktor/SFTPBundle/maintainability)
SFTP Bundle
=====================This bundle provides a simple interface for transfer files by SFTP protocol.
Installation
==============1) Install the bundle using Composer:
```bash
composer require nw/sftp-bundle
```2) Enable bundle in `AppKernel.php`
```php
class AppKernel extends Kernel
{
public function registerBundles()
{
return array(
// ... other bundles
new NW\SFTPBundle\NWSFTPBundle()
);
}
}
```Usage
=======1) Connect to the SFTP server:
```php
$sftp = $this->get('nw.sftp');
$sftp->connect($host, $port);
$sftp->login($username, $password);
// or
$sftp->loginWithKey($host, $username, $pubkeyfile, $privkeyfile, $passphrase = null);
```2) Use SFTP client to transfer files:
```php
$sftp->fetch('/path/to/remoteFile', '/path/to/localFile');
// or
$sftp->send('/path/to/localFile', '/path/to/remoteFile');
```3) From CLI could be used one of the following commands:
```bash
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
```