Optimize reading of large files when using php-smbclient

This commit is contained in:
Robin Appelman 2017-08-16 16:43:55 +02:00
commit 8c89cb8972
3 changed files with 108 additions and 7 deletions

View file

@ -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);