3 files changed +22
-28
lines changed Original file line number Diff line number Diff line change 14
14
],
15
15
"require" : {
16
16
"jaz303/phake" : " ~0.6" ,
17
- "phpseclib/phpseclib" : " ~1 .0"
17
+ "phpseclib/phpseclib" : " ^2 .0"
18
18
},
19
19
"require-dev" : {
20
20
"phpunit/phpunit" : " @stable"
Original file line number Diff line number Diff line change 1
1
<?php
2
2
namespace Pomander ;
3
3
4
+ use phpseclib \Crypt \RSA ;
5
+ use phpseclib \Net \SSH2 ;
6
+
4
7
class RemoteShell
5
8
{
6
9
/**
7
10
* SSH
8
11
*
9
- * @var \Net_SSH2
12
+ * @var SSH2
10
13
*/
11
14
protected $ shell ;
12
15
@@ -43,9 +46,9 @@ public function write($cmd)
43
46
/* protected */
44
47
protected function connect ()
45
48
{
46
- $ this ->shell = new \ Net_SSH2 ($ this ->host , $ this ->port );
49
+ $ this ->shell = new SSH2 ($ this ->host , $ this ->port );
47
50
if (file_exists ($ this ->auth )) {
48
- $ key = new \ Crypt_RSA ();
51
+ $ key = new RSA ();
49
52
if ($ this ->key_pass ) {
50
53
$ key ->setPassword ($ this ->key_pass );
51
54
}
@@ -70,7 +73,7 @@ protected function process()
70
73
$ offset = 0 ;
71
74
$ this ->shell ->_initShell ();
72
75
while ( true ) {
73
- $ temp = $ this ->shell ->_get_channel_packet (NET_SSH2_CHANNEL_EXEC );
76
+ $ temp = $ this ->shell ->_get_channel_packet (SSH2 :: CHANNEL_EXEC );
74
77
switch ( true ) {
75
78
case $ temp === true :
76
79
case $ temp === false :
0 commit comments