From ddb222622b92d1c2b7db975a84167a00579a1ad0 Mon Sep 17 00:00:00 2001 From: Santeri Hurnanen Date: Tue, 7 Nov 2023 14:47:39 +0200 Subject: [PATCH 1/2] UHF-X: Add patch for drupal.org issue #3387094 https://www.drupal.org/project/flysystem/issues/3387094#comment-15271717 --- ...dd-context-property-to-stream-wrapper.patch | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 patches/3387094-add-context-property-to-stream-wrapper.patch diff --git a/patches/3387094-add-context-property-to-stream-wrapper.patch b/patches/3387094-add-context-property-to-stream-wrapper.patch new file mode 100644 index 0000000..f935469 --- /dev/null +++ b/patches/3387094-add-context-property-to-stream-wrapper.patch @@ -0,0 +1,18 @@ +diff --git a/src/FlysystemStreamWrapper.php b/src/FlysystemStreamWrapper.php +index 93a79b6..5c5a200 100644 +--- a/src/FlysystemStreamWrapper.php ++++ b/src/FlysystemStreamWrapper.php +@@ -25,6 +25,13 @@ class FlysystemStreamWrapper + */ + const STREAM_URL_IGNORE_SIZE = 8; + ++ /** ++ * PHP-passed stream context. ++ * ++ * @var resource|null ++ */ ++ public $context; ++ + /** + * The registered filesystems. + * From ba64a9c982f1f03bf879b5b891b6ce3337ef0900 Mon Sep 17 00:00:00 2001 From: Santeri Hurnanen Date: Tue, 7 Nov 2023 14:51:45 +0200 Subject: [PATCH 2/2] UHF-X: Add $context property to flysystem stream wrapper PHP requires that stream wrapper implementations have public $context property. This property is missing from drupal/flysystem stream wrappers. Since PHP 8.2, assigning dynamic properties is deprecated. See: - https://www.php.net/manual/en/class.streamwrapper.php#streamwrapper.props.context - https://www.drupal.org/project/flysystem/issues/3387094 - https://github.com/twistor/flysystem-stream-wrapper/issues/27 --- composer.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/composer.json b/composer.json index eb154fd..0f1078b 100644 --- a/composer.json +++ b/composer.json @@ -11,5 +11,12 @@ "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", "drupal/coder": "^8.3" + }, + "extra": { + "patches": { + "twistor/flysystem-stream-wrapper": { + "PHP 8.2 support (https://www.drupal.org/project/flysystem/issues/3387094)": "https://raw.githubusercontent.com/City-of-Helsinki/drupal-module-helfi-azure-fs/ddb222622b92d1c2b7db975a84167a00579a1ad0/patches/3387094-add-context-property-to-stream-wrapper.patch" + } + } } }