Skip to content

Commit 1240911

Browse files
committedMay 13, 2016
Merge pull request #65 from max-voloshin/update-phpseclib
Update phpseclib (PHP 7 compatibility)
2 parents 7121f2b + 1bd20bc commit 1240911

File tree

3 files changed

+22
-28
lines changed

3 files changed

+22
-28
lines changed
 

‎composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
],
1515
"require": {
1616
"jaz303/phake": "~0.6",
17-
"phpseclib/phpseclib": "~1.0"
17+
"phpseclib/phpseclib": "^2.0"
1818
},
1919
"require-dev": {
2020
"phpunit/phpunit": "@stable"

‎composer.lock

+14-23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎lib/Pomander/RemoteShell.php

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
<?php
22
namespace Pomander;
33

4+
use phpseclib\Crypt\RSA;
5+
use phpseclib\Net\SSH2;
6+
47
class RemoteShell
58
{
69
/**
710
* SSH
811
*
9-
* @var \Net_SSH2
12+
* @var SSH2
1013
*/
1114
protected $shell;
1215

@@ -43,9 +46,9 @@ public function write($cmd)
4346
/* protected */
4447
protected function connect()
4548
{
46-
$this->shell = new \Net_SSH2($this->host, $this->port);
49+
$this->shell = new SSH2($this->host, $this->port);
4750
if (file_exists($this->auth)) {
48-
$key = new \Crypt_RSA();
51+
$key = new RSA();
4952
if ($this->key_pass) {
5053
$key->setPassword($this->key_pass);
5154
}
@@ -70,7 +73,7 @@ protected function process()
7073
$offset = 0;
7174
$this->shell->_initShell();
7275
while( true ) {
73-
$temp = $this->shell->_get_channel_packet(NET_SSH2_CHANNEL_EXEC);
76+
$temp = $this->shell->_get_channel_packet(SSH2::CHANNEL_EXEC);
7477
switch( true ) {
7578
case $temp === true:
7679
case $temp === false:

0 commit comments

Comments
 (0)
Failed to load comments.