2017 © Pedro Peláez
 

library yii2-ssh-console

SSH library for yii2 console commands

image

thelfensdrfer/yii2-ssh-console

SSH library for yii2 console commands

  • Thursday, July 28, 2016
  • by thelfensdrfer
  • Repository
  • 4 Watchers
  • 20 Stars
  • 10,218 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 1 Open issues
  • 15 Versions
  • 10 % Grown

The README.md

Yii2 SSH Console

Controller with ssh commands for the yii2 console., (*1)

Example

<?php namespace app\commands;

use \yii2sshconsole\Controller;

class DeployController extends Controller
{
    public $defaultAction = 'exec';

    public function actionExec()
    {
        $this->connect('example.com', [
            'username' => 'myusername',
            'password' => 'mypassword', // optional
        ]);

        // Or via private key
        /*
        $this->connect('example.com', [
            'username' => 'myusername',
            'key' => '/path/to/private.key',
            'password' => 'mykeypassword', // optional
        ]);
        */

        $output = $this->run('echo "test"');
        echo 'Output: ' . $output; // Output: test

        $output = $this->run([
            'cd /path/to/install',
            './put_offline.sh',
            'git pull -f',
            'composer install',
            './yii migrate --interactive=0',
            './build.sh',
            './yii cache/flush',
            './put_online.sh',
        ]);

        // Or via callback
        $this->run([
            'cd /path/to/install',
            './put_offline.sh',
            'git pull -f',
            'composer install',
            './yii migrate --interactive=0',
            './build.sh',
            './yii cache/flush',
            './put_online.sh',
        ], function($line) {
            echo $line;
        });
    }
}

And then in the local console:, (*2)

./yii deploy

The Versions

28/07 2016

dev-master

9999999-dev

SSH library for yii2 console commands

  Sources   Download

MIT

The Requires

 

by Tim Helfensdoerfer

10/03 2016

1.1.2

1.1.2.0

SSH library for yii2 console commands

  Sources   Download

MIT

The Requires

 

by Tim Helfensdoerfer

10/03 2016

1.1.1

1.1.1.0

SSH library for yii2 console commands

  Sources   Download

MIT

The Requires

 

by Tim Helfensdoerfer

10/03 2016

1.1.0

1.1.0.0

SSH library for yii2 console commands

  Sources   Download

MIT

The Requires

 

by Tim Helfensdoerfer

25/04 2014

1.0.4

1.0.4.0

SSH library for yii2 console commands

  Sources   Download

MIT

The Requires

 

by Tim Helfensdoerfer

24/04 2014

dev-develop

dev-develop

SSH library for yii2 console commands

  Sources   Download

MIT

The Requires

 

by Tim Helfensdoerfer

24/04 2014

1.0.3

1.0.3.0

SSH library for yii2 console commands

  Sources   Download

MIT

The Requires

 

by Tim Helfensdoerfer

24/04 2014

1.0.2

1.0.2.0

SSH library for yii2 console commands

  Sources   Download

MIT

The Requires

 

by Tim Helfensdoerfer

24/04 2014

0.1.1

0.1.1.0

SSH library for yii2 console commands

  Sources   Download

MIT

The Requires

 

by Tim Helfensdoerfer

24/04 2014

0.1.2

0.1.2.0

SSH library for yii2 console commands

  Sources   Download

MIT

The Requires

 

by Tim Helfensdoerfer

24/04 2014

0.1.3

0.1.3.0

SSH library for yii2 console commands

  Sources   Download

MIT

The Requires

 

by Tim Helfensdoerfer

24/04 2014

0.1.4

0.1.4.0

SSH library for yii2 console commands

  Sources   Download

MIT

The Requires

 

by Tim Helfensdoerfer

24/04 2014

1.0.0

1.0.0.0

SSH library for yii2 console commands

  Sources   Download

MIT

The Requires

 

by Tim Helfensdoerfer

24/04 2014

1.0.1

1.0.1.0

SSH library for yii2 console commands

  Sources   Download

MIT

The Requires

 

by Tim Helfensdoerfer

24/04 2014

0.1.0

0.1.0.0

SSH library for yii2 console commands

  Sources   Download

MIT

The Requires

 

by Tim Helfensdoerfer