update icewind/streams to 0.4.1

This commit is contained in:
Robin Appelman 2016-06-09 17:10:52 +02:00
parent 574b1e8d17
commit 8dea26094b
5 changed files with 57 additions and 70 deletions

View File

@ -9,7 +9,7 @@
},
"require": {
"icewind/smb": "1.1.0",
"icewind/streams": "0.4"
"icewind/streams": "0.4.1"
}
}

View File

@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "8de0823d3d0a167ee24450a111cb67b9",
"content-hash": "6733058865c1765823b31cfbb24552e1",
"hash": "8ed3150b0b3e916ad66558242b4cf2a0",
"content-hash": "70722dcee13b3ac1c1951479b7431c97",
"packages": [
{
"name": "icewind/smb",
@ -51,16 +51,16 @@
},
{
"name": "icewind/streams",
"version": "0.4.0",
"version": "0.4.1",
"source": {
"type": "git",
"url": "https://github.com/icewind1991/Streams.git",
"reference": "9ca40274645a967ecc3408b0ca2e6255ead1d1d3"
"reference": "d3620e8dc410c86c2ba55579803679c4e0b289ac"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/icewind1991/Streams/zipball/9ca40274645a967ecc3408b0ca2e6255ead1d1d3",
"reference": "9ca40274645a967ecc3408b0ca2e6255ead1d1d3",
"url": "https://api.github.com/repos/icewind1991/Streams/zipball/d3620e8dc410c86c2ba55579803679c4e0b289ac",
"reference": "d3620e8dc410c86c2ba55579803679c4e0b289ac",
"shasum": ""
},
"require": {
@ -88,7 +88,7 @@
}
],
"description": "A set of generic stream wrappers",
"time": "2016-03-17 12:32:25"
"time": "2016-06-02 14:37:52"
}
],
"packages-dev": [],

View File

@ -42,13 +42,6 @@ return array(
'Icewind\\SMB\\Server' => $vendorDir . '/icewind/smb/src/Server.php',
'Icewind\\SMB\\Share' => $vendorDir . '/icewind/smb/src/Share.php',
'Icewind\\SMB\\System' => $vendorDir . '/icewind/smb/src/System.php',
'Icewind\\SMB\\Test\\AbstractShare' => $vendorDir . '/icewind/smb/tests/AbstractShare.php',
'Icewind\\SMB\\Test\\NativeShare' => $vendorDir . '/icewind/smb/tests/NativeShare.php',
'Icewind\\SMB\\Test\\NativeStream' => $vendorDir . '/icewind/smb/tests/NativeStream.php',
'Icewind\\SMB\\Test\\Parser' => $vendorDir . '/icewind/smb/tests/Parser.php',
'Icewind\\SMB\\Test\\Server' => $vendorDir . '/icewind/smb/tests/Server.php',
'Icewind\\SMB\\Test\\Share' => $vendorDir . '/icewind/smb/tests/Share.php',
'Icewind\\SMB\\Test\\TestCase' => $vendorDir . '/icewind/smb/tests/TestCase.php',
'Icewind\\SMB\\TimeZoneProvider' => $vendorDir . '/icewind/smb/src/TimeZoneProvider.php',
'Icewind\\Streams\\CallbackWrapper' => $vendorDir . '/icewind/streams/src/CallbackWrapper.php',
'Icewind\\Streams\\Directory' => $vendorDir . '/icewind/streams/src/Directory.php',
@ -60,14 +53,6 @@ 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\\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\\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\\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

@ -1,47 +1,4 @@
[
{
"name": "icewind/streams",
"version": "0.4.0",
"version_normalized": "0.4.0.0",
"source": {
"type": "git",
"url": "https://github.com/icewind1991/Streams.git",
"reference": "9ca40274645a967ecc3408b0ca2e6255ead1d1d3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/icewind1991/Streams/zipball/9ca40274645a967ecc3408b0ca2e6255ead1d1d3",
"reference": "9ca40274645a967ecc3408b0ca2e6255ead1d1d3",
"shasum": ""
},
"require": {
"php": ">=5.3"
},
"require-dev": {
"phpunit/phpunit": "^4.8",
"satooshi/php-coveralls": "v1.0.0"
},
"time": "2016-03-17 12:32:25",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"Icewind\\Streams\\Tests\\": "tests/",
"Icewind\\Streams\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Robin Appelman",
"email": "icewind@owncloud.com"
}
],
"description": "A set of generic stream wrappers"
},
{
"name": "icewind/smb",
"version": "v1.1.0",
@ -85,5 +42,48 @@
}
],
"description": "php wrapper for smbclient and libsmbclient-php"
},
{
"name": "icewind/streams",
"version": "0.4.1",
"version_normalized": "0.4.1.0",
"source": {
"type": "git",
"url": "https://github.com/icewind1991/Streams.git",
"reference": "d3620e8dc410c86c2ba55579803679c4e0b289ac"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/icewind1991/Streams/zipball/d3620e8dc410c86c2ba55579803679c4e0b289ac",
"reference": "d3620e8dc410c86c2ba55579803679c4e0b289ac",
"shasum": ""
},
"require": {
"php": ">=5.3"
},
"require-dev": {
"phpunit/phpunit": "^4.8",
"satooshi/php-coveralls": "v1.0.0"
},
"time": "2016-06-02 14:37:52",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"Icewind\\Streams\\Tests\\": "tests/",
"Icewind\\Streams\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Robin Appelman",
"email": "icewind@owncloud.com"
}
],
"description": "A set of generic stream wrappers"
}
]

View File

@ -44,7 +44,7 @@ class RetryWrapper extends Wrapper {
$result = parent::stream_read($count);
$bytesReceived = strlen($result);
while ($bytesReceived < $count && !$this->stream_eof()) {
while (strlen($result) > 0 && $bytesReceived < $count && !$this->stream_eof()) {
$result .= parent::stream_read($count - $bytesReceived);
$bytesReceived = strlen($result);
}
@ -54,11 +54,13 @@ class RetryWrapper extends Wrapper {
public function stream_write($data) {
$bytesToSend = strlen($data);
$result = parent::stream_write($data);
$bytesWritten = parent::stream_write($data);
$result = $bytesWritten;
while ($result < $bytesToSend && !$this->stream_eof()) {
while ($bytesWritten > 0 && $result < $bytesToSend && !$this->stream_eof()) {
$dataLeft = substr($data, $result);
$result += parent::stream_write($dataLeft);
$bytesWritten = parent::stream_write($dataLeft);
$result += $bytesWritten;
}
return $result;