Skip to content

Commit

Permalink
Merge pull request #65 from max-voloshin/update-phpseclib
Browse files Browse the repository at this point in the history
Update phpseclib (PHP 7 compatibility)
  • Loading branch information
tamagokun committed May 13, 2016
2 parents 7121f2b + 1bd20bc commit 1240911
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 28 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
],
"require": {
"jaz303/phake": "~0.6",
"phpseclib/phpseclib": "~1.0"
"phpseclib/phpseclib": "^2.0"
},
"require-dev": {
"phpunit/phpunit": "@stable"
Expand Down
37 changes: 14 additions & 23 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions lib/Pomander/RemoteShell.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
<?php
namespace Pomander;

use phpseclib\Crypt\RSA;
use phpseclib\Net\SSH2;

class RemoteShell
{
/**
* SSH
*
* @var \Net_SSH2
* @var SSH2
*/
protected $shell;

Expand Down Expand Up @@ -43,9 +46,9 @@ public function write($cmd)
/* protected */
protected function connect()
{
$this->shell = new \Net_SSH2($this->host, $this->port);
$this->shell = new SSH2($this->host, $this->port);
if (file_exists($this->auth)) {
$key = new \Crypt_RSA();
$key = new RSA();
if ($this->key_pass) {
$key->setPassword($this->key_pass);
}
Expand All @@ -70,7 +73,7 @@ protected function process()
$offset = 0;
$this->shell->_initShell();
while( true ) {
$temp = $this->shell->_get_channel_packet(NET_SSH2_CHANNEL_EXEC);
$temp = $this->shell->_get_channel_packet(SSH2::CHANNEL_EXEC);
switch( true ) {
case $temp === true:
case $temp === false:
Expand Down

0 comments on commit 1240911

Please sign in to comment.