mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-04 01:34:07 +02:00
Split out and improve tests
This commit is contained in:
parent
5c57d2d094
commit
65b76d6428
3 changed files with 74 additions and 95 deletions
|
|
@ -35,7 +35,8 @@ class RawConnection {
|
|||
setlocale(LC_ALL, Server::LOCALE);
|
||||
$env = array_merge($env, array(
|
||||
'CLI_FORCE_INTERACTIVE' => 'y', // Needed or the prompt isn't displayed!!
|
||||
'LC_ALL' => Server::LOCALE
|
||||
'LC_ALL' => Server::LOCALE,
|
||||
'LANG' => Server::LOCALE
|
||||
));
|
||||
$this->process = proc_open($command, $descriptorSpec, $this->pipes, '/', $env);
|
||||
if (!$this->isValid()) {
|
||||
|
|
@ -72,8 +73,8 @@ class RawConnection {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public function read() {
|
||||
return trim(fgets($this->getOutputStream()));
|
||||
public function readLine() {
|
||||
return stream_get_line($this->getOutputStream(), 4086, "\n");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -83,7 +84,7 @@ class RawConnection {
|
|||
*/
|
||||
public function readAll() {
|
||||
$output = array();
|
||||
while ($line = $this->read()) {
|
||||
while ($line = $this->readLine()) {
|
||||
$output[] = $line;
|
||||
}
|
||||
return $output;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue