mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 17:24:07 +02:00
fixes requested changes for #70 (No php-libsmb fallback)
This commit is contained in:
parent
99f721a436
commit
dd7b852d6c
2 changed files with 9 additions and 9 deletions
|
|
@ -347,21 +347,14 @@ class Share extends AbstractShare {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Append to stream
|
* Append to stream
|
||||||
* Note: smbclient does not support it so we use php-libsmbclient
|
* Note: smbclient does not support this (Use php-libsmbclient)
|
||||||
*
|
*
|
||||||
* @param string $target
|
* @param string $target
|
||||||
*
|
*
|
||||||
* @throws \Icewind\SMB\Exception\DependencyException
|
* @throws \Icewind\SMB\Exception\DependencyException
|
||||||
* @throws \Icewind\SMB\Exception\NotFoundException
|
|
||||||
* @throws \Icewind\SMB\Exception\InvalidTypeException
|
|
||||||
*/
|
*/
|
||||||
public function append($target) {
|
public function append($target) {
|
||||||
if (!NativeServer::available($this->server->getSystem())) {
|
throw new DependencyException('php-libsmbclient not installed');
|
||||||
throw new DependencyException('php-libsmbclient not installed');
|
|
||||||
}
|
|
||||||
|
|
||||||
$share = new NativeShare($this->server, $this->getName());
|
|
||||||
return $share->append($target);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,13 @@ class ShareTest extends AbstractShareTest {
|
||||||
$this->share->mkdir($this->root);
|
$this->share->mkdir($this->root);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @expectedException \Icewind\SMB\Exception\DependencyException
|
||||||
|
*/
|
||||||
|
public function testAppendStream() {
|
||||||
|
$this->share->append($this->root . '/foo');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException \Icewind\SMB\Exception\ConnectException
|
* @expectedException \Icewind\SMB\Exception\ConnectException
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue