Download the PHP package wiardvanrij/sshwrapper without Composer

On this page you can find all versions of the php package wiardvanrij/sshwrapper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sshwrapper

SSH wrapper for PHP

Information

!!! This is in very beta. I would not recommend using this on production or whatsoever. !!!

This library allows you to connect via SSH to your linux server with the PHP core class 'ssh2'. It also allows to use a "jump server" for instance:

command --ssh to-> jump server --ssh to-> actual server

Requirements

You will need to install the PHP ssh2 extension and enable this. I assume you have knowledge on how to install php extensions

Installation

Via composer

{
    "require": {
        "wiardvanrij/sshwrapper": "*"
    }
}

Because this library is in beta, please use the latest version. There is no stable

Usage

Require the autoloader and include the namespace

<?php

require('vendor/autoload.php');

use SshWrapper\SshCore;

Initiate the class with the host

$ssh = new SshCore('123.123.123.123');

Optional: Define the rsa public and private key locations if they differ from default. Defaults:

$ssh->authPriv = '~/.ssh/id_rsa';
$ssh->authPub = '~/.ssh/id_rsa.pub';

Optional: Define user and port if they differ from the default. Defaults:

$ssh->authUser = 'root';
$ssh->port = 22;

Prefered: If you use the ssh server as "jump server" you can define the actual server here including the user.

$ssh->jumphost = '[email protected]';

Connect

$ssh->connect();

And execute a command

$result = $ssh->exec('ls -lah');

var_dump($result);

Result is a string of the output

Disconnect to close the ssh connection

$ssh->disconnect();

All versions of sshwrapper with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package wiardvanrij/sshwrapper contains the following files

Loading the files please wait ....