aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2022-07-21 16:36:32 +0200
committerRobin Appelman <robin@icewind.nl>2022-07-21 16:36:32 +0200
commit13eef55a925f397afbb5c7d4e058ae080b1ac824 (patch)
treeacf7abef5dd0cf6613b917e087a43fbe37bc0dc0 /lib
parent6c42874f04477a9741089bd4763ad47ad4130b2f (diff)
downloadnextcloud-server-13eef55a925f397afbb5c7d4e058ae080b1ac824.tar.gz
nextcloud-server-13eef55a925f397afbb5c7d4e058ae080b1ac824.zip
always triger setup of builtin storage wrappers
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/SetupManager.php21
1 files changed, 15 insertions, 6 deletions
diff --git a/lib/private/Files/SetupManager.php b/lib/private/Files/SetupManager.php
index f19c9bfa062..5782a5a72a6 100644
--- a/lib/private/Files/SetupManager.php
+++ b/lib/private/Files/SetupManager.php
@@ -82,6 +82,7 @@ class SetupManager {
private IConfig $config;
private bool $listeningForProviders;
private array $fullSetupRequired = [];
+ private bool $setupBuiltinWrappersDone = false;
public function __construct(
IEventLogger $eventLogger,
@@ -121,6 +122,15 @@ class SetupManager {
}
private function setupBuiltinWrappers() {
+ if ($this->setupBuiltinWrappersDone) {
+ return;
+ }
+ $this->setupBuiltinWrappersDone = true;
+
+ // load all filesystem apps before, so no setup-hook gets lost
+ OC_App::loadApps(['filesystem']);
+ $prevLogging = Filesystem::logWarningWhenAddingStorageWrapper(false);
+
Filesystem::addStorageWrapper('mount_options', function ($mountPoint, IStorage $storage, IMountPoint $mount) {
if ($storage->instanceOfStorage(Common::class)) {
$storage->setMountOptions($mount->getOptions());
@@ -188,6 +198,8 @@ class SetupManager {
}
return $storage;
});
+
+ Filesystem::logWarningWhenAddingStorageWrapper($prevLogging);
}
/**
@@ -223,6 +235,9 @@ class SetupManager {
return;
}
$this->setupUsers[] = $user->getUID();
+
+ $this->setupBuiltinWrappers();
+
$prevLogging = Filesystem::logWarningWhenAddingStorageWrapper(false);
OC_Hook::emit('OC_Filesystem', 'preSetup', ['user' => $user->getUID()]);
@@ -321,14 +336,8 @@ class SetupManager {
$this->eventLogger->start('setup_root_fs', 'Setup root filesystem');
- // load all filesystem apps before, so no setup-hook gets lost
- OC_App::loadApps(['filesystem']);
- $prevLogging = Filesystem::logWarningWhenAddingStorageWrapper(false);
-
$this->setupBuiltinWrappers();
- Filesystem::logWarningWhenAddingStorageWrapper($prevLogging);
-
$rootMounts = $this->mountProviderCollection->getRootMounts();
foreach ($rootMounts as $rootMountProvider) {
$this->mountManager->addMount($rootMountProvider);