Skip to content

Commit d6ed49c

Browse files
committed
Big refactor and ability connecting via ssh
1 parent 14dba21 commit d6ed49c

23 files changed

+846
-36
lines changed
6.74 MB
Binary file not shown.

package.php.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
name: jphp-gui-jediterm-ext
2-
version: 1.2.1
2+
version: 1.3.0
33

44
deps:
55
jphp-runtime: '*'
66
jphp-gui-ext: '*'
7+
jphp-ssh-ext: '*'
78
devDeps:
89
dn-bundle-plugin: '*'
910

@@ -44,10 +45,10 @@ config:
4445
- /dn-sources/**
4546

4647
develnext-bundle:
47-
version: 1.0.0
48+
version: '%version%'
4849
name: Jediterm
4950
author: MWGuy
5051
icon: "develnext/bundle/jediterm/icon32.png"
51-
description: "Продвинутый эмулятор терминала"
52+
description: "Продвинутый эмулятор терминала с поддержкой SSH"
5253
group: "system"
5354
class: "develnext\\bundle\\jediterm\\JeditermBundle"

sdk/php/intellij/pty/PtyProcess.php renamed to sdk/php/intellij/tty/PtyProcess.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace php\intellij\pty;
3+
namespace php\intellij\tty;
44

55
use php\io\File;
66
use php\io\Stream;
@@ -12,8 +12,9 @@ abstract class PtyProcess {
1212
* @param string[] $command
1313
* @param string[] $env
1414
* @param File|null $workDir
15+
* @return PtyProcess
1516
*/
16-
public static function exec(array $command, array $env = [], File $workDir = null) {
17+
public static function exec(array $command, array $env = [], File $workDir = null): PtyProcess {
1718

1819
}
1920

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<?php
2+
3+
4+
namespace php\intellij\tty;
5+
6+
7+
class PtyProcessConnector extends TtyConnector {
8+
9+
/**
10+
* PtyProcessConnector constructor.
11+
* @param PtyProcess $process
12+
*/
13+
public function __construct(PtyProcess $process) {
14+
// Some java code ...
15+
}
16+
17+
/**
18+
* @return PtyProcess
19+
*/
20+
public function getPtyProcess(): PtyProcess {
21+
// Some java code ...
22+
}
23+
24+
/**
25+
* @return void
26+
*/
27+
public function close() {
28+
// Some java code ...
29+
}
30+
31+
/**
32+
* @param array $termSize
33+
* @param array $pixelSize
34+
*/
35+
public function resize(array $termSize, array $pixelSize) {
36+
// Some java code ...
37+
}
38+
39+
/**
40+
* @return string
41+
*/
42+
public function getName(): string {
43+
// Some java code ...
44+
}
45+
46+
/**
47+
* @param string $buf
48+
* @param int $offset
49+
* @param int $length
50+
* @return int
51+
*/
52+
public function read(string $buf, int $offset, int $length): int {
53+
// Some java code ...
54+
}
55+
56+
/**
57+
* @param string $buf
58+
*/
59+
public function write(string $buf) {
60+
// Some java code ...
61+
}
62+
63+
/**
64+
* @return bool
65+
*/
66+
public function isConnected(): bool {
67+
// Some java code ...
68+
}
69+
70+
/**
71+
* @return int
72+
*/
73+
public function waitFor(): int {
74+
// Some java code ...
75+
}
76+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
3+
namespace php\intellij\tty;
4+
5+
abstract class TtyConnector {
6+
7+
/**
8+
* @return void
9+
*/
10+
abstract public function close();
11+
12+
/**
13+
* @param array $termSize
14+
* @param array $pixelSize
15+
*/
16+
abstract public function resize(array $termSize, array $pixelSize);
17+
18+
/**
19+
* @return string
20+
*/
21+
abstract public function getName(): string;
22+
23+
/**
24+
* @param string $buf
25+
* @param int $offset
26+
* @param int $length
27+
* @return int
28+
*/
29+
abstract public function read(string $buf, int $offset, int $length): int;
30+
31+
/**
32+
* @param string $buf
33+
*/
34+
abstract public function write(string $buf);
35+
36+
/**
37+
* @return bool
38+
*/
39+
abstract public function isConnected(): bool;
40+
41+
/**
42+
* @return int
43+
*/
44+
abstract public function waitFor(): int;
45+
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?php
2+
3+
namespace php\intellij\tty;
4+
5+
class UnImplTtyConnector extends TtyConnector {
6+
7+
/**
8+
* UnImplTtyConnector constructor.
9+
*/
10+
public function __construct() {
11+
// Some java code ...
12+
}
13+
14+
/**
15+
* @return void
16+
*/
17+
public function close() {
18+
// Some java code ...
19+
}
20+
21+
/**
22+
* @param array $termSize
23+
* @param array $pixelSize
24+
*/
25+
public function resize(array $termSize, array $pixelSize) {
26+
// Some java code ...
27+
}
28+
29+
/**
30+
* @return string
31+
*/
32+
public function getName(): string {
33+
// Some java code ...
34+
}
35+
36+
/**
37+
* @param string $buf
38+
* @param int $offset
39+
* @param int $length
40+
* @return int
41+
*/
42+
public function read(string $buf, int $offset, int $length): int {
43+
// Some java code ...
44+
}
45+
46+
/**
47+
* @param string $buf
48+
*/
49+
public function write(string $buf) {
50+
// Some java code ...
51+
}
52+
53+
/**
54+
* @return bool
55+
*/
56+
public function isConnected(): bool {
57+
// Some java code ...
58+
}
59+
60+
/**
61+
* @return int
62+
*/
63+
public function waitFor(): int {
64+
// Some java code ...
65+
}
66+
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?php
2+
3+
namespace php\intellij\tty\ssh;
4+
5+
use php\intellij\tty\TtyConnector;
6+
use ssh\SSHSession;
7+
8+
class SSHExecTtyConnector extends TtyConnector {
9+
10+
/**
11+
* SSHExecTtyConnector constructor.
12+
* @param SSHSession $session
13+
* @param string $command
14+
*/
15+
public function __construct(SSHSession $session, string $command) {
16+
// Some java code ...
17+
}
18+
19+
/**
20+
* @return void
21+
*/
22+
public function close() {
23+
// Some java code ...
24+
}
25+
26+
/**
27+
* @param array $termSize
28+
* @param array $pixelSize
29+
*/
30+
public function resize(array $termSize, array $pixelSize) {
31+
// Some java code ...
32+
}
33+
34+
/**
35+
* @return string
36+
*/
37+
public function getName(): string {
38+
// Some java code ...
39+
}
40+
41+
/**
42+
* @param string $buf
43+
* @param int $offset
44+
* @param int $length
45+
* @return int
46+
*/
47+
public function read(string $buf, int $offset, int $length): int {
48+
// Some java code ...
49+
}
50+
51+
/**
52+
* @param string $buf
53+
*/
54+
public function write(string $buf) {
55+
// Some java code ...
56+
}
57+
58+
/**
59+
* @return bool
60+
*/
61+
public function isConnected(): bool {
62+
// Some java code ...
63+
}
64+
65+
/**
66+
* @return int
67+
*/
68+
public function waitFor(): int {
69+
// Some java code ...
70+
}
71+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<?php
2+
3+
namespace php\intellij\tty\ssh;
4+
5+
use php\intellij\tty\TtyConnector;
6+
use ssh\SSHSession;
7+
8+
class SSHShellTtyConnector extends TtyConnector {
9+
10+
/**
11+
* SSHShellTtyConnector constructor.
12+
* @param SSHSession $session
13+
*/
14+
public function __construct(SSHSession $session) {
15+
// Some java code ...
16+
}
17+
18+
/**
19+
* @return void
20+
*/
21+
public function close() {
22+
// Some java code ...
23+
}
24+
25+
/**
26+
* @param array $termSize
27+
* @param array $pixelSize
28+
*/
29+
public function resize(array $termSize, array $pixelSize) {
30+
// Some java code ...
31+
}
32+
33+
/**
34+
* @return string
35+
*/
36+
public function getName(): string {
37+
// Some java code ...
38+
}
39+
40+
/**
41+
* @param string $buf
42+
* @param int $offset
43+
* @param int $length
44+
* @return int
45+
*/
46+
public function read(string $buf, int $offset, int $length): int {
47+
// Some java code ...
48+
}
49+
50+
/**
51+
* @param string $buf
52+
*/
53+
public function write(string $buf) {
54+
// Some java code ...
55+
}
56+
57+
/**
58+
* @return bool
59+
*/
60+
public function isConnected(): bool {
61+
// Some java code ...
62+
}
63+
64+
/**
65+
* @return int
66+
*/
67+
public function waitFor(): int {
68+
// Some java code ...
69+
}
70+
}

0 commit comments

Comments
 (0)