summaryrefslogtreecommitdiffstats
path: root/apps/files_external/3rdparty/icewind
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/3rdparty/icewind')
-rw-r--r--apps/files_external/3rdparty/icewind/streams/src/CallbackWrapper.php2
-rw-r--r--apps/files_external/3rdparty/icewind/streams/src/Path.php12
-rw-r--r--apps/files_external/3rdparty/icewind/streams/src/PathWrapper.php25
-rw-r--r--apps/files_external/3rdparty/icewind/streams/src/Wrapper.php2
4 files changed, 5 insertions, 36 deletions
diff --git a/apps/files_external/3rdparty/icewind/streams/src/CallbackWrapper.php b/apps/files_external/3rdparty/icewind/streams/src/CallbackWrapper.php
index 4eef55681c7..c5847b95fdb 100644
--- a/apps/files_external/3rdparty/icewind/streams/src/CallbackWrapper.php
+++ b/apps/files_external/3rdparty/icewind/streams/src/CallbackWrapper.php
@@ -107,8 +107,6 @@ class CallbackWrapper extends Wrapper {
$result = parent::stream_close();
if (is_callable($this->closeCallback)) {
call_user_func($this->closeCallback);
- // prevent further calls by potential PHP 7 GC ghosts
- $this->closeCallback = null;
}
return $result;
}
diff --git a/apps/files_external/3rdparty/icewind/streams/src/Path.php b/apps/files_external/3rdparty/icewind/streams/src/Path.php
index bef9fd5f616..46d2156b69a 100644
--- a/apps/files_external/3rdparty/icewind/streams/src/Path.php
+++ b/apps/files_external/3rdparty/icewind/streams/src/Path.php
@@ -56,7 +56,7 @@ class Path {
protected function register() {
if (!$this->registered) {
- $this->appendDefaultContent($this->contextOptions);
+ $this->appendDefaultContent($this->getProtocol(), $this->contextOptions);
stream_wrapper_register($this->getProtocol(), $this->class);
$this->registered = true;
}
@@ -71,17 +71,13 @@ class Path {
/**
* Add values to the default stream context
*
+ * @param string $key
* @param array $values
*/
- protected function appendDefaultContent($values) {
- if (!is_array(current($values))) {
- $values = array($this->getProtocol() => $values);
- }
+ protected function appendDefaultContent($key, $values) {
$context = stream_context_get_default();
$defaults = stream_context_get_options($context);
- foreach ($values as $key => $value) {
- $defaults[$key] = $value;
- }
+ $defaults[$key] = $values;
stream_context_set_default($defaults);
}
diff --git a/apps/files_external/3rdparty/icewind/streams/src/PathWrapper.php b/apps/files_external/3rdparty/icewind/streams/src/PathWrapper.php
deleted file mode 100644
index 88af7e17b33..00000000000
--- a/apps/files_external/3rdparty/icewind/streams/src/PathWrapper.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-/**
- * Copyright (c) 2016 Robin Appelman <icewind@owncloud.com>
- * This file is licensed under the Licensed under the MIT license:
- * http://opensource.org/licenses/MIT
- */
-
-namespace Icewind\Streams;
-
-/**
- * A string-like object that maps to an existing stream when opened
- */
-class PathWrapper extends NullWrapper {
- /**
- * @param resource $source
- * @return Path|string
- */
- public static function getPath($source) {
- return new Path(__CLASS__, [
- 'null' => [
- 'source' => $source
- ]
- ]);
- }
-}
diff --git a/apps/files_external/3rdparty/icewind/streams/src/Wrapper.php b/apps/files_external/3rdparty/icewind/streams/src/Wrapper.php
index 8e52eff9a08..53de2942ca9 100644
--- a/apps/files_external/3rdparty/icewind/streams/src/Wrapper.php
+++ b/apps/files_external/3rdparty/icewind/streams/src/Wrapper.php
@@ -53,7 +53,7 @@ abstract class Wrapper implements File, Directory {
if (isset($context[$name])) {
$context = $context[$name];
} else {
- throw new \BadMethodCallException('Invalid context, "' . $name . '" options not set');
+ throw new \BadMethodCallException('Invalid context, "callable" options not set');
}
if (isset($context['source']) and is_resource($context['source'])) {
$this->setSourceStream($context['source']);