update icewind/smb to 1.0.8

This commit is contained in:
Robin Appelman 2016-03-17 14:41:10 +01:00 committed by Thomas Müller
parent 8af75c734a
commit 204288f4a5
7 changed files with 38 additions and 25 deletions

View File

@ -8,7 +8,7 @@
"classmap-authoritative": true
},
"require": {
"icewind/smb": "1.0.7",
"icewind/smb": "1.0.8",
"icewind/streams": "0.4"
}
}

View File

@ -4,21 +4,21 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "1eea7879a98792c704df2d7c86d37577",
"content-hash": "aeb32fd12aaab76f3c8873dd81f5775b",
"hash": "1671a5ec7bef407432d42775f898dc34",
"content-hash": "9d995f0d55bee8a3b344a3c685e7b4a4",
"packages": [
{
"name": "icewind/smb",
"version": "v1.0.7",
"version": "v1.0.8",
"source": {
"type": "git",
"url": "https://github.com/icewind1991/SMB.git",
"reference": "b9364a984e9667416406c6f21c1bc5ac7ad86aa1"
"reference": "764f3fc793a904eb937d619ad097fb076ff199cd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/icewind1991/SMB/zipball/b9364a984e9667416406c6f21c1bc5ac7ad86aa1",
"reference": "b9364a984e9667416406c6f21c1bc5ac7ad86aa1",
"url": "https://api.github.com/repos/icewind1991/SMB/zipball/764f3fc793a904eb937d619ad097fb076ff199cd",
"reference": "764f3fc793a904eb937d619ad097fb076ff199cd",
"shasum": ""
},
"require": {
@ -47,7 +47,7 @@
}
],
"description": "php wrapper for smbclient and libsmbclient-php",
"time": "2016-03-17 12:48:14"
"time": "2016-03-17 13:29:58"
},
{
"name": "icewind/streams",

View File

@ -60,18 +60,14 @@ return array(
'Icewind\\Streams\\Path' => $vendorDir . '/icewind/streams/src/Path.php',
'Icewind\\Streams\\RetryWrapper' => $vendorDir . '/icewind/streams/src/RetryWrapper.php',
'Icewind\\Streams\\SeekableWrapper' => $vendorDir . '/icewind/streams/src/SeekableWrapper.php',
'Icewind\\Streams\\Tests\\CallbackWrapper' => $vendorDir . '/icewind/streams/tests/CallbackWrapper.php',
'Icewind\\Streams\\Tests\\DirectoryFilter' => $vendorDir . '/icewind/streams/tests/DirectoryFilter.php',
'Icewind\\Streams\\Tests\\DirectoryWrapper' => $vendorDir . '/icewind/streams/tests/DirectoryWrapper.php',
'Icewind\\Streams\\Tests\\DirectoryWrapperDummy' => $vendorDir . '/icewind/streams/tests/DirectoryWrapper.php',
'Icewind\\Streams\\Tests\\DirectoryWrapperNull' => $vendorDir . '/icewind/streams/tests/DirectoryWrapper.php',
'Icewind\\Streams\\Tests\\IteratorDirectory' => $vendorDir . '/icewind/streams/tests/IteratorDirectory.php',
'Icewind\\Streams\\Tests\\NullWrapper' => $vendorDir . '/icewind/streams/tests/NullWrapper.php',
'Icewind\\Streams\\Tests\\PartialWrapper' => $vendorDir . '/icewind/streams/tests/RetryWrapper.php',
'Icewind\\Streams\\Tests\\RetryWrapper' => $vendorDir . '/icewind/streams/tests/RetryWrapper.php',
'Icewind\\Streams\\Tests\\SeekableWrapper' => $vendorDir . '/icewind/streams/tests/SeekableWrapper.php',
'Icewind\\Streams\\Tests\\UrlCallBack' => $vendorDir . '/icewind/streams/tests/UrlCallBack.php',
'Icewind\\Streams\\Tests\\Wrapper' => $vendorDir . '/icewind/streams/tests/Wrapper.php',
'Icewind\\Streams\\Url' => $vendorDir . '/icewind/streams/src/Url.php',
'Icewind\\Streams\\UrlCallback' => $vendorDir . '/icewind/streams/src/UrlCallBack.php',
'Icewind\\Streams\\Wrapper' => $vendorDir . '/icewind/streams/src/Wrapper.php',

View File

@ -44,17 +44,17 @@
},
{
"name": "icewind/smb",
"version": "v1.0.7",
"version_normalized": "1.0.7.0",
"version": "v1.0.8",
"version_normalized": "1.0.8.0",
"source": {
"type": "git",
"url": "https://github.com/icewind1991/SMB.git",
"reference": "b9364a984e9667416406c6f21c1bc5ac7ad86aa1"
"reference": "764f3fc793a904eb937d619ad097fb076ff199cd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/icewind1991/SMB/zipball/b9364a984e9667416406c6f21c1bc5ac7ad86aa1",
"reference": "b9364a984e9667416406c6f21c1bc5ac7ad86aa1",
"url": "https://api.github.com/repos/icewind1991/SMB/zipball/764f3fc793a904eb937d619ad097fb076ff199cd",
"reference": "764f3fc793a904eb937d619ad097fb076ff199cd",
"shasum": ""
},
"require": {
@ -65,7 +65,7 @@
"phpunit/phpunit": "^4.8",
"satooshi/php-coveralls": "v1.0.0"
},
"time": "2016-03-17 12:48:14",
"time": "2016-03-17 13:29:58",
"type": "library",
"installation-source": "source",
"autoload": {

View File

@ -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);
}
/**

View File

@ -32,20 +32,27 @@ 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;
}

View File

@ -0,0 +1,7 @@
{
"name": "icewind/streams-dummy",
"provide": {
"icewind/streams": "0.2"
}
}