Bläddra i källkod

Merge pull request #14579 from nextcloud/fix/bump_streams_files_external

Have streams of files_external in sync
tags/v16.0.0beta1
Roeland Jago Douma 5 år sedan
förälder
incheckning
7ff1f8366a
Inget konto är kopplat till bidragsgivarens mejladress

+ 1
- 1
apps/files_external/3rdparty/composer.json Visa fil

"classmap-authoritative": true "classmap-authoritative": true
}, },
"require": { "require": {
"icewind/streams": "0.6.1",
"icewind/streams": "0.7.1",
"icewind/smb": "3.1.1" "icewind/smb": "3.1.1"
} }
} }

+ 6
- 6
apps/files_external/3rdparty/composer.lock Visa fil

"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "dd320be9cd87742d53b4384bf3df9c42",
"content-hash": "5639a09feff2318b1b69e11a10a81e7d",
"packages": [ "packages": [
{ {
"name": "icewind/smb", "name": "icewind/smb",
}, },
{ {
"name": "icewind/streams", "name": "icewind/streams",
"version": "0.6.1",
"version": "v0.7.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/icewind1991/Streams.git", "url": "https://github.com/icewind1991/Streams.git",
"reference": "0a78597117d8a02937ea05206f219294449fb06e"
"reference": "4db3ed6c366e90b958d00e1d4c6360a9b39b2121"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/icewind1991/Streams/zipball/0a78597117d8a02937ea05206f219294449fb06e",
"reference": "0a78597117d8a02937ea05206f219294449fb06e",
"url": "https://api.github.com/repos/icewind1991/Streams/zipball/4db3ed6c366e90b958d00e1d4c6360a9b39b2121",
"reference": "4db3ed6c366e90b958d00e1d4c6360a9b39b2121",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
} }
], ],
"description": "A set of generic stream wrappers", "description": "A set of generic stream wrappers",
"time": "2018-04-24T09:07:38+00:00"
"time": "2019-02-15T12:57:29+00:00"
} }
], ],
"packages-dev": [], "packages-dev": [],

+ 6
- 6
apps/files_external/3rdparty/composer/installed.json Visa fil

}, },
{ {
"name": "icewind/streams", "name": "icewind/streams",
"version": "0.6.1",
"version_normalized": "0.6.1.0",
"version": "v0.7.1",
"version_normalized": "0.7.1.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/icewind1991/Streams.git", "url": "https://github.com/icewind1991/Streams.git",
"reference": "0a78597117d8a02937ea05206f219294449fb06e"
"reference": "4db3ed6c366e90b958d00e1d4c6360a9b39b2121"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/icewind1991/Streams/zipball/0a78597117d8a02937ea05206f219294449fb06e",
"reference": "0a78597117d8a02937ea05206f219294449fb06e",
"url": "https://api.github.com/repos/icewind1991/Streams/zipball/4db3ed6c366e90b958d00e1d4c6360a9b39b2121",
"reference": "4db3ed6c366e90b958d00e1d4c6360a9b39b2121",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"phpunit/phpunit": "^4.8", "phpunit/phpunit": "^4.8",
"satooshi/php-coveralls": "v1.0.0" "satooshi/php-coveralls": "v1.0.0"
}, },
"time": "2018-04-24T09:07:38+00:00",
"time": "2019-02-15T12:57:29+00:00",
"type": "library", "type": "library",
"installation-source": "dist", "installation-source": "dist",
"autoload": { "autoload": {

+ 15
- 3
apps/files_external/3rdparty/icewind/streams/src/CallbackWrapper.php Visa fil

*/ */
protected $readDirCallBack; protected $readDirCallBack;


/**
* @var callable
*/
protected $preCloseCallback;

/** /**
* Wraps a stream with the provided callbacks * Wraps a stream with the provided callbacks
* *
* *
* @throws \BadMethodCallException * @throws \BadMethodCallException
*/ */
public static function wrap($source, $read = null, $write = null, $close = null, $readDir = null) {
public static function wrap($source, $read = null, $write = null, $close = null, $readDir = null, $preClose = null) {
$context = stream_context_create(array( $context = stream_context_create(array(
'callback' => array( 'callback' => array(
'source' => $source, 'source' => $source,
'read' => $read, 'read' => $read,
'write' => $write, 'write' => $write,
'close' => $close, 'close' => $close,
'readDir' => $readDir
'readDir' => $readDir,
'preClose' => $preClose,
) )
)); ));
return Wrapper::wrapSource($source, $context, 'callback', '\Icewind\Streams\CallbackWrapper'); return Wrapper::wrapSource($source, $context, 'callback', '\Icewind\Streams\CallbackWrapper');
$this->writeCallback = $context['write']; $this->writeCallback = $context['write'];
$this->closeCallback = $context['close']; $this->closeCallback = $context['close'];
$this->readDirCallBack = $context['readDir']; $this->readDirCallBack = $context['readDir'];
$this->preCloseCallback = $context['preClose'];
return true; return true;
} }


public function stream_read($count) { public function stream_read($count) {
$result = parent::stream_read($count); $result = parent::stream_read($count);
if (is_callable($this->readCallback)) { if (is_callable($this->readCallback)) {
call_user_func($this->readCallback, $count);
call_user_func($this->readCallback, strlen($result));
} }
return $result; return $result;
} }
} }


public function stream_close() { public function stream_close() {
if (is_callable($this->preCloseCallback)) {
call_user_func($this->preCloseCallback, $this->loadContext('callback')['source']);
// prevent further calls by potential PHP 7 GC ghosts
$this->preCloseCallback = null;
}
$result = parent::stream_close(); $result = parent::stream_close();
if (is_callable($this->closeCallback)) { if (is_callable($this->closeCallback)) {
call_user_func($this->closeCallback); call_user_func($this->closeCallback);

Laddar…
Avbryt
Spara