behnampro/yii2-ssh2

SSH2 library for yii2

Installs: 9 515

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 0

Forks: 4

pkg:composer/behnampro/yii2-ssh2

v0.1.2 2018-01-31 13:32 UTC

This package is not auto-updated.

Last update: 2025-10-15 08:30:44 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License

Pure PHP library widget (based on phpseclib) for Yii2.

modified for integrity and fix confilict with Yii2

by : Behnam mirzaee

Installation

The preferred way to install this extension is through composer.

Either run

composer require behnampro/yii2-ssh2 "*"

or add

"behnampro/yii2-ssh2": "*"

to the require section of your composer.json file.

Usage

Example

use behnampro\yii2ssh\Yii2ssh;

$yii_ssh = new Yii2ssh();
$host = "127.0.0.1";
$auth['username'] = 'admin';
$auth['password'] = 'password';
if($yii_ssh->connect($host, $auth))
{
    $yii_ssh->run_ssh([
        'ls -al',
    ], function($line) {
        echo $line;
    });
}

Ref

The project is modified based on thelfensdrfer/yii2sshconsole