1 | <?php |
||
18 | class Connection extends RawConnection { |
||
19 | const DELIMITER = 'smb:'; |
||
20 | const DELIMITER_LENGTH = 4; |
||
21 | |||
22 | /** @var Parser */ |
||
23 | private $parser; |
||
24 | 486 | ||
25 | 486 | /** |
|
26 | 486 | * @param string $command |
|
27 | 486 | * @param Parser $parser |
|
28 | * @param array<string, string> $env |
||
29 | */ |
||
30 | public function __construct(string $command, Parser $parser, array $env = []) { |
||
34 | 486 | ||
35 | 486 | /** |
|
36 | * send input to smbclient |
||
37 | * |
||
38 | * @param string $input |
||
39 | */ |
||
40 | public function write(string $input) { |
||
43 | |||
44 | 486 | /** |
|
45 | 486 | * @throws ConnectException |
|
46 | 486 | */ |
|
47 | 486 | public function clearTillPrompt(): void { |
|
61 | |||
62 | /** |
||
63 | * get all unprocessed output from smbclient until the next prompt |
||
64 | 484 | * |
|
65 | 484 | * @param (callable(string):bool)|null $callback (optional) callback to call for every line read |
|
|
|||
66 | * @return string[] |
||
67 | * @throws AuthenticationException |
||
68 | 484 | * @throws ConnectException |
|
69 | 484 | * @throws ConnectionException |
|
70 | * @throws InvalidHostException |
||
71 | 484 | * @throws NoLoginServerException |
|
72 | 484 | * @throws AccessDeniedException |
|
73 | 2 | */ |
|
74 | public function read(callable $callback = null): array { |
||
107 | |||
108 | private function isPrompt(string $line): bool { |
||
111 | |||
112 | /** |
||
113 | * @param string|bool $promptLine (optional) prompt line that might contain some info about the error |
||
114 | * @throws ConnectException |
||
115 | * @return no-return |
||
116 | */ |
||
117 | private function unknownError($promptLine = '') { |
||
129 | |||
130 | public function close(bool $terminate = true): void { |
||
137 | } |
||
138 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.