update icewind/smb to 1.0.8

This commit is contained in:
Robin Appelman 2016-03-17 14:41:10 +01:00
parent dfbd85d723
commit 792752772d
7 changed files with 38 additions and 25 deletions

View File

@ -8,7 +8,7 @@
"classmap-authoritative": true "classmap-authoritative": true
}, },
"require": { "require": {
"icewind/smb": "1.0.7", "icewind/smb": "1.0.8",
"icewind/streams": "0.4" "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", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"hash": "1eea7879a98792c704df2d7c86d37577", "hash": "1671a5ec7bef407432d42775f898dc34",
"content-hash": "aeb32fd12aaab76f3c8873dd81f5775b", "content-hash": "9d995f0d55bee8a3b344a3c685e7b4a4",
"packages": [ "packages": [
{ {
"name": "icewind/smb", "name": "icewind/smb",
"version": "v1.0.7", "version": "v1.0.8",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/icewind1991/SMB.git", "url": "https://github.com/icewind1991/SMB.git",
"reference": "b9364a984e9667416406c6f21c1bc5ac7ad86aa1" "reference": "764f3fc793a904eb937d619ad097fb076ff199cd"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/icewind1991/SMB/zipball/b9364a984e9667416406c6f21c1bc5ac7ad86aa1", "url": "https://api.github.com/repos/icewind1991/SMB/zipball/764f3fc793a904eb937d619ad097fb076ff199cd",
"reference": "b9364a984e9667416406c6f21c1bc5ac7ad86aa1", "reference": "764f3fc793a904eb937d619ad097fb076ff199cd",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -47,7 +47,7 @@
} }
], ],
"description": "php wrapper for smbclient and libsmbclient-php", "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", "name": "icewind/streams",

View File

@ -60,18 +60,14 @@ return array(
'Icewind\\Streams\\Path' => $vendorDir . '/icewind/streams/src/Path.php', 'Icewind\\Streams\\Path' => $vendorDir . '/icewind/streams/src/Path.php',
'Icewind\\Streams\\RetryWrapper' => $vendorDir . '/icewind/streams/src/RetryWrapper.php', 'Icewind\\Streams\\RetryWrapper' => $vendorDir . '/icewind/streams/src/RetryWrapper.php',
'Icewind\\Streams\\SeekableWrapper' => $vendorDir . '/icewind/streams/src/SeekableWrapper.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\\DirectoryFilter' => $vendorDir . '/icewind/streams/tests/DirectoryFilter.php',
'Icewind\\Streams\\Tests\\DirectoryWrapper' => $vendorDir . '/icewind/streams/tests/DirectoryWrapper.php', 'Icewind\\Streams\\Tests\\DirectoryWrapper' => $vendorDir . '/icewind/streams/tests/DirectoryWrapper.php',
'Icewind\\Streams\\Tests\\DirectoryWrapperDummy' => $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\\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\\PartialWrapper' => $vendorDir . '/icewind/streams/tests/RetryWrapper.php',
'Icewind\\Streams\\Tests\\RetryWrapper' => $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\\SeekableWrapper' => $vendorDir . '/icewind/streams/tests/SeekableWrapper.php',
'Icewind\\Streams\\Tests\\UrlCallBack' => $vendorDir . '/icewind/streams/tests/UrlCallBack.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\\Url' => $vendorDir . '/icewind/streams/src/Url.php',
'Icewind\\Streams\\UrlCallback' => $vendorDir . '/icewind/streams/src/UrlCallBack.php', 'Icewind\\Streams\\UrlCallback' => $vendorDir . '/icewind/streams/src/UrlCallBack.php',
'Icewind\\Streams\\Wrapper' => $vendorDir . '/icewind/streams/src/Wrapper.php', 'Icewind\\Streams\\Wrapper' => $vendorDir . '/icewind/streams/src/Wrapper.php',

View File

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

View File

@ -239,8 +239,9 @@ class NativeShare extends AbstractShare {
*/ */
public function read($source) { public function read($source) {
$this->connect(); $this->connect();
$handle = $this->state->open($this->buildUrl($source), 'r'); $url = $this->buildUrl($source);
return NativeStream::wrap($this->state, $handle, 'r'); $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) { public function write($source) {
$this->connect(); $this->connect();
$handle = $this->state->create($this->buildUrl($source)); $url = $this->buildUrl($source);
return NativeStream::wrap($this->state, $handle, 'w'); $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; private $eof = false;
/**
* @var string
*/
private $url;
/** /**
* Wrap a stream from libsmbclient-php into a regular php stream * Wrap a stream from libsmbclient-php into a regular php stream
* *
* @param \Icewind\SMB\NativeState $state * @param \Icewind\SMB\NativeState $state
* @param resource $smbStream * @param resource $smbStream
* @param string $mode * @param string $mode
* @param string $url
* @return resource * @return resource
*/ */
public static function wrap($state, $smbStream, $mode) { public static function wrap($state, $smbStream, $mode, $url) {
stream_wrapper_register('nativesmb', '\Icewind\SMB\NativeStream'); stream_wrapper_register('nativesmb', '\Icewind\SMB\NativeStream');
$context = stream_context_create(array( $context = stream_context_create(array(
'nativesmb' => array( 'nativesmb' => array(
'state' => $state, 'state' => $state,
'handle' => $smbStream 'handle' => $smbStream,
'url' => $url
) )
)); ));
$fh = fopen('nativesmb://', $mode, false, $context); $fh = fopen('nativesmb://', $mode, false, $context);
@ -69,6 +76,7 @@ class NativeStream implements File {
$context = stream_context_get_options($this->context); $context = stream_context_get_options($this->context);
$this->state = $context['nativesmb']['state']; $this->state = $context['nativesmb']['state'];
$this->handle = $context['nativesmb']['handle']; $this->handle = $context['nativesmb']['handle'];
$this->url = $context['nativesmb']['url'];
return true; return true;
} }
@ -91,7 +99,7 @@ class NativeStream implements File {
public function stream_stat() { public function stream_stat() {
try { try {
return $this->state->fstat($this->handle); return $this->state->stat($this->url);
} catch (Exception $e) { } catch (Exception $e) {
return false; return false;
} }

View File

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