mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 17:24:07 +02:00
Optimize reading of large files when using php-smbclient
This commit is contained in:
parent
4ca899f582
commit
8c89cb8972
3 changed files with 108 additions and 7 deletions
|
|
@ -20,22 +20,22 @@ class NativeStream implements File {
|
|||
/**
|
||||
* @var \Icewind\SMB\NativeState
|
||||
*/
|
||||
private $state;
|
||||
protected $state;
|
||||
|
||||
/**
|
||||
* @var resource
|
||||
*/
|
||||
private $handle;
|
||||
protected $handle;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private $eof = false;
|
||||
protected $eof = false;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $url;
|
||||
protected $url;
|
||||
|
||||
/**
|
||||
* Wrap a stream from libsmbclient-php into a regular php stream
|
||||
|
|
@ -50,9 +50,9 @@ class NativeStream implements File {
|
|||
stream_wrapper_register('nativesmb', '\Icewind\SMB\NativeStream');
|
||||
$context = stream_context_create(array(
|
||||
'nativesmb' => array(
|
||||
'state' => $state,
|
||||
'state' => $state,
|
||||
'handle' => $smbStream,
|
||||
'url' => $url
|
||||
'url' => $url
|
||||
)
|
||||
));
|
||||
$fh = fopen('nativesmb://', $mode, false, $context);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue