diff options
author | Robin Appelman <icewind@owncloud.com> | 2016-03-17 14:41:10 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2016-03-21 14:24:00 +0100 |
commit | 792752772d9bc35168bd1ac002b1a27dc7746f77 (patch) | |
tree | 4b8749fdd5c47135b1d08c8d666361ce747ed85d /apps/files_external/3rdparty/icewind | |
parent | dfbd85d7231d3440b2831c61a83ba8cb1512523e (diff) | |
download | nextcloud-server-792752772d9bc35168bd1ac002b1a27dc7746f77.tar.gz nextcloud-server-792752772d9bc35168bd1ac002b1a27dc7746f77.zip |
update icewind/smb to 1.0.8
Diffstat (limited to 'apps/files_external/3rdparty/icewind')
3 files changed, 24 insertions, 7 deletions
diff --git a/apps/files_external/3rdparty/icewind/smb/src/NativeShare.php b/apps/files_external/3rdparty/icewind/smb/src/NativeShare.php index 0b184fd585c..27d975514a3 100644 --- a/apps/files_external/3rdparty/icewind/smb/src/NativeShare.php +++ b/apps/files_external/3rdparty/icewind/smb/src/NativeShare.php @@ -239,8 +239,9 @@ class NativeShare extends AbstractShare { */ public function read($source) { $this->connect(); - $handle = $this->state->open($this->buildUrl($source), 'r'); - return NativeStream::wrap($this->state, $handle, 'r'); + $url = $this->buildUrl($source); + $handle = $this->state->open($url, 'r'); + return NativeStream::wrap($this->state, $handle, 'r', $url); } /** @@ -254,8 +255,9 @@ class NativeShare extends AbstractShare { */ public function write($source) { $this->connect(); - $handle = $this->state->create($this->buildUrl($source)); - return NativeStream::wrap($this->state, $handle, 'w'); + $url = $this->buildUrl($source); + $handle = $this->state->create($url); + return NativeStream::wrap($this->state, $handle, 'w', $url); } /** diff --git a/apps/files_external/3rdparty/icewind/smb/src/NativeStream.php b/apps/files_external/3rdparty/icewind/smb/src/NativeStream.php index 8ffa8836924..481395b025a 100644 --- a/apps/files_external/3rdparty/icewind/smb/src/NativeStream.php +++ b/apps/files_external/3rdparty/icewind/smb/src/NativeStream.php @@ -33,19 +33,26 @@ class NativeStream implements File { private $eof = false; /** + * @var string + */ + private $url; + + /** * Wrap a stream from libsmbclient-php into a regular php stream * * @param \Icewind\SMB\NativeState $state * @param resource $smbStream * @param string $mode + * @param string $url * @return resource */ - public static function wrap($state, $smbStream, $mode) { + public static function wrap($state, $smbStream, $mode, $url) { stream_wrapper_register('nativesmb', '\Icewind\SMB\NativeStream'); $context = stream_context_create(array( 'nativesmb' => array( 'state' => $state, - 'handle' => $smbStream + 'handle' => $smbStream, + 'url' => $url ) )); $fh = fopen('nativesmb://', $mode, false, $context); @@ -69,6 +76,7 @@ class NativeStream implements File { $context = stream_context_get_options($this->context); $this->state = $context['nativesmb']['state']; $this->handle = $context['nativesmb']['handle']; + $this->url = $context['nativesmb']['url']; return true; } @@ -91,7 +99,7 @@ class NativeStream implements File { public function stream_stat() { try { - return $this->state->fstat($this->handle); + return $this->state->stat($this->url); } catch (Exception $e) { return false; } diff --git a/apps/files_external/3rdparty/icewind/streams-dummy/composer.json b/apps/files_external/3rdparty/icewind/streams-dummy/composer.json new file mode 100644 index 00000000000..ad6a6a1b1c1 --- /dev/null +++ b/apps/files_external/3rdparty/icewind/streams-dummy/composer.json @@ -0,0 +1,7 @@ +{ + "name": "icewind/streams-dummy", + "provide": { + "icewind/streams": "0.2" + } +} + |