2017 © Pedro Peláez
 

library php-sftp-client

Tiny PHP Sftp client

image

kisphp/php-sftp-client

Tiny PHP Sftp client

  • Friday, September 23, 2016
  • by kisphp
  • Repository
  • 2 Watchers
  • 3 Stars
  • 14 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Simple PHP SFTP Client

example workflow, (*1)

Installation

Add in composer:, (*2)

{
    "require": {
        "kisphp/php-sftp-client": "~0.1"
    }
}

Usage

Create a config class that implements ConfigInterface, (*3)

<?php

use Kisphp\ConfigInterface;

class Config implements ConfigInterface
{
    public function getHost()
    {
        return '10.10.0.61';
    }

    public function getPort()
    {
        return 22;
    }

    public function getUsername()
    {
        return 'vagrant';
    }

    public function getPassword()
    {
        return 'vagrant';
    }
}

Instantiate SftpConnect class and pass your Config object to it, (*4)

$s = new SftpConnect(new Config());

Upload a file

$s->sendFile(__DIR__ . '/source.php', 'b.php'); // will return true for success and false for failure

Download a file

$s->receiveFile('a.php', 'c.php'); // will return true for success and false for failure

The Versions

23/09 2016

dev-master

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

Tiny PHP Sftp client

  Sources   Download

MIT

The Requires

  • ext-ssh2 *

 

The Development Requires

ssh sftp ftp kisphp