From c3e0ea1636bd1672f40b4284075f72b5526e2b93 Mon Sep 17 00:00:00 2001 From: ralf Date: Fri, 16 Sep 2022 09:33:09 +0200 Subject: [PATCH] nicer way to set current Vfs user and also not overwriting the default context --- api/src/Vfs/UserContextTrait.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/Vfs/UserContextTrait.php b/api/src/Vfs/UserContextTrait.php index e1ec74bc0e..5214961727 100644 --- a/api/src/Vfs/UserContextTrait.php +++ b/api/src/Vfs/UserContextTrait.php @@ -61,9 +61,9 @@ trait UserContextTrait } // if we have no user set, set the current one / Api\Vfs::$user - if (empty(stream_context_get_options($this->context)[Vfs::SCHEME]['user']) && !empty(Api\Vfs::$user)) + if (empty($this->user) && !empty(Api\Vfs::$user)) { - stream_context_set_option($this->context, [Vfs::SCHEME => ['user' => Api\Vfs::$user]]); + $this->user = Api\Vfs::$user; } }