2017 © Pedro PelĂĄez
 

library phpseclib-wrapper-bundle

PHPSeclib Wrapper with connections manager, logging, os-specific helpers, ...

image

dedipanel/phpseclib-wrapper-bundle

PHPSeclib Wrapper with connections manager, logging, os-specific helpers, ...

  • Sunday, March 29, 2015
  • by NiR-
  • Repository
  • 1 Watchers
  • 3 Stars
  • 2,778 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 5 % Grown

The README.md

PHPSeclib Wrapper Bundle

Build Status Scrutinizer Quality Score, (*1)

This bundle contains useful methods (connection management, easy key storing, verification on installed packets ...) on top of PHPSeclib library (pure php ssh/sftp client)., (*2)

You can easily connect to ssh/sftp servers and do some basic operations (upload, download, mkdir, touch, chmod, ...). You can also access directly the phpseclib API. The wrapper provide logging functionnality., (*3)

Install

composer require phpseclib/phpseclib 2.0.*@dev
composer require dedipanel/phpseclib-wrapper-bundle ~1.0

How to use

Server

You can use Server objects provided by the Bundle or you can implement your own Serer class on top of Dedipanel\PHPSeclibWrapperBundle\Server\ServerInterface., (*4)

$server = new Dedipanel\PHPSeclibWrapperBundle\Server\Server;
$server
    ->setHostname('localhost')
    ->setPort(22)
    ->setUser('test')
    ->setPassword('test)
;

 Connection Manager

The bundle provide a connection manager, allowing to use the same connection at different points :, (*5)

$logger  = new Psr\Log\NullLogger(); // logger used to log ssh/sftp interactions.
$manager = $this->container->get('dedipanel.connection_manager');

$connection   = $manager->getConnectionFromServer($server);
$connectionId = $manager->getConnectionId($connection);

Generate private/public key

The bundle provide easy way to generate public/private key (see KeyHelper) and to store it (see FileKeyStore). By default, these keys are stored and retrieved to/from files, but you can implements you own KeyStore strategy., (*6)

$keyHelper    = $this->container->get('dedipanel.key_helper');
$privateKeyId = uniqid(true); 
$publicKey    = $keyHelper->createKey($privateKeyId);

You can also use the KeyHelper for directly uploading the public key to the server. You will need to provide a Connection instance for that :, (*7)

$keyHelper->createKey($privateKeyId, $connection);

Logging

The Versions

29/03 2015

dev-master

9999999-dev

PHPSeclib Wrapper with connections manager, logging, os-specific helpers, ...

  Sources   Download

MIT

The Requires

 

The Development Requires

ssh sftp phpseclib

26/12 2014

1.0.0

1.0.0.0

PHPSeclib Wrapper with connections manager, logging, os-specific helpers, ...

  Sources   Download

MIT

The Requires

 

The Development Requires

ssh sftp phpseclib