2017 © Pedro Peláez
 

library sftp-service-provider

SFTP Service Provider for Silex

image

achrafsoltani/sftp-service-provider

SFTP Service Provider for Silex

  • Wednesday, June 15, 2016
  • by AchrafSoltani
  • Repository
  • 1 Watchers
  • 1 Stars
  • 24 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

SftpServiceProvider

A Simple SFTP wrapper for Silex, (*1)

Latest Stable Version Total Downloads License, (*2)

Features

  • Easy setup.
  • Files : List, Upload, Download, Rename, Delete.
  • Folders: List, Mkdir, Rename, Delete.

Requirements

  • PHP 5.3+
  • ext-ssh2
  • monolog/monolog (through the MonologServiceProvider)

Dependencies

// Installing php-ssh2
$ sudo apt-get install libssh2-php
// checking if all is good
$ php -m |grep ssh2 

Installation

$ composer require achrafsoltani/sftp-service-provider

Setup

``` {.php} require_once DIR.'/vendor/autoload.php';, (*3)

use Silex\Application; use AchrafSoltani\Provider\SftpServiceProvider; use Silex\Provider\MonologServiceProvider;, (*4)

$app = new Application();, (*5)

// Monolog $app->register(new Silex\Provider\MonologServiceProvider(), array( 'monolog.logfile' => DIR.'/logs/development.log', ));, (*6)

// SFTP $app->register(new SftpServiceProvider(), array( 'sftp.options' => array( 'hostname' => 'domain.tld', // or IP address 'username' => 'root', 'password' => 'your_ssh_password', 'port' => '22' // optional ) ));, (*7)

// Usage, (*8)

$app->run();, (*9)

Usage
------------
* Example 1 : Listing files in a directory

``` {.php}
$dirs = $app['sftp']->list_files('/home/user/');
var_dump($dirs);
  • Example 2 : Downloading a File

{.php} $app['sftp']->download('/home/user/source_file.ext', '/home/user/path/to/destination/downloaded.ext');, (*10)

The Versions

15/06 2016

dev-master

9999999-dev http://www.achrafsoltani.com

SFTP Service Provider for Silex

  Sources   Download

MIT

The Requires

 

by Achraf Soltani

service silex sftp ftp

15/06 2016

v2.0.0

2.0.0.0 http://www.achrafsoltani.com

SFTP Service Provider for Silex

  Sources   Download

MIT

The Requires

 

by Achraf Soltani

service silex sftp ftp

28/05 2015

v1.0.0

1.0.0.0 http://www.achrafsoltani.com

SFTP Service Provider for Silex

  Sources   Download

MIT

The Requires

 

by Achraf Soltani

service silex sftp ftp