public function read(callable $callback = null) {
		if (!$this->isValid()) {
			throw new ConnectionException('Connection not valid');
		}
		$promptLine = $this->readLine(); //first line is prompt
		$this->parser->checkConnectionError($promptLine);

		$output = [];
		if (!$this->isPrompt($promptLine)) {
			$line = $promptLine;
		} else {
			$line = $this->readLine();
		}
		if ($line === false) {
			$this->unknownError($promptLine);
		}
		while (!$this->isPrompt($line)) { //next prompt functions as delimiter
			if (is_callable($callback)) {
				$result = $callback($line);
				if ($result === false) { // allow the callback to close the connection for infinite running commands
					$this->close(true);
					break;
				}
			} else {
				$output[] .= $line;
			}
			$line = $this->readLine();
		}
		return $output;
	}
public function read(callable $callback = null) {
		if (!$this->isValid()) {
			throw new ConnectionException('Connection not valid');
		}
		$promptLine = $this->readLine(); //first line is prompt
		$this->parser->checkConnectionError($promptLine);

		$output = [];
		if (!$this->isPrompt($promptLine)) {
			$line = $promptLine;
		} else {
			$line = $this->readLine();
		}
		if ($line === false) {
			$this->unknownError($promptLine);
		}
		while (!$this->isPrompt($line)) { //next prompt functions as delimiter
			if (is_callable($callback)) {
				$result = $callback($line);
				if ($result === false) { // allow the callback to close the connection for infinite running commands
					$this->close(true);
					break;
				}
			} else {
				$output[] .= $line;
			}
			$line = $this->readLine();
		}
		return $output;
	}
public function read ( callable $ callback = null ) { if ( ! $ this -> isValid ( ) ) { throw new ConnectionException ( 'Connection not valid' ) ; } $ promptLine = $ this -> readLine ( ) ; //first line is prompt $ this -> parser -> checkConnectionError ( $ promptLine ) ; $ output = [ ] ; if ( ! $ this -> isPrompt ( $ promptLine ) ) { $ line = $ promptLine ; } else { $ line = $ this -> readLine ( ) ; } if ( $ line === false ) { $ this -> unknownError ( $ promptLine ) ; } while ( ! $ this -> isPrompt ( $ line ) ) { //next prompt functions as delimiter if ( is_callable ( $ callback ) ) { $ result = $ callback ( $ line ) ; if ( $ result === false ) { // allow the callback to close the connection for infinite running commands $ this -> close ( true ) ; break ; } } else { $ output [ ] .= $ line ; } $ line = $ this -> readLine ( ) ; } return $ output ; }
get all unprocessed output from smbclient until the next prompt

@param callable $callback (optional) callback to call for every line read
@return string[]
@throws AuthenticationException
@throws ConnectException
@throws ConnectionException
@throws InvalidHostException
@throws NoLoginServerException
get all unprocessed output from smbclient until the next prompt