1 | <?php |
||
16 | class Connection extends RawConnection { |
||
17 | const DELIMITER = 'smb:'; |
||
18 | const DELIMITER_LENGTH = 4; |
||
19 | |||
20 | /** |
||
21 | * send input to smbclient |
||
22 | * |
||
23 | * @param string $input |
||
24 | */ |
||
25 | public function write($input) { |
||
28 | |||
29 | /** |
||
30 | * get all unprocessed output from smbclient until the next prompt |
||
31 | * |
||
32 | * @param callable $callback (optional) callback to call for every line read |
||
33 | * @return string |
||
34 | * @throws AuthenticationException |
||
35 | * @throws ConnectException |
||
36 | * @throws ConnectionException |
||
37 | * @throws InvalidHostException |
||
38 | * @throws NoLoginServerException |
||
39 | */ |
||
40 | public function read(callable $callback = null) { |
||
65 | |||
66 | /** |
||
67 | * Check |
||
68 | * |
||
69 | * @param $line |
||
70 | * @return bool |
||
71 | */ |
||
72 | private function isPrompt($line) { |
||
75 | |||
76 | /** |
||
77 | * @param string $promptLine (optional) prompt line that might contain some info about the error |
||
78 | * @throws ConnectException |
||
79 | */ |
||
80 | private function unknownError($promptLine = '') { |
||
92 | |||
93 | /** |
||
94 | * check if the first line holds a connection failure |
||
95 | * |
||
96 | * @param $line |
||
97 | * @throws AuthenticationException |
||
98 | * @throws InvalidHostException |
||
99 | * @throws NoLoginServerException |
||
100 | */ |
||
101 | private function checkConnectionError($line) { |
||
119 | |||
120 | public function close($terminate = true) { |
||
126 | } |
||
127 |