From be1e8aa8d4e42c404269e444d974d61a74acdefd Mon Sep 17 00:00:00 2001 From: lukinovec Date: Mon, 3 Aug 2026 12:54:38 +0200 Subject: [PATCH] Add comments for clarity --- src/Bootstrappers/FilesystemTenancyBootstrapper.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Bootstrappers/FilesystemTenancyBootstrapper.php b/src/Bootstrappers/FilesystemTenancyBootstrapper.php index 23233c08..f5a1533c 100644 --- a/src/Bootstrappers/FilesystemTenancyBootstrapper.php +++ b/src/Bootstrappers/FilesystemTenancyBootstrapper.php @@ -226,6 +226,8 @@ class FilesystemTenancyBootstrapper implements TenancyBootstrapper } foreach ($this->fileCacheStores() as $name) { + // Capture the paths only once. The config holds the central values on the first + // bootstrap, but not necessarily later (if an earlier bootstrap threw, revert() didn't run). $this->originalCachePaths[$name] ??= [ 'path' => $this->app['config']["cache.stores.{$name}.path"], 'lock_path' => $this->app['config']["cache.stores.{$name}.lock_path"], @@ -241,6 +243,8 @@ class FilesystemTenancyBootstrapper implements TenancyBootstrapper foreach ($this->fileCacheStores() as $name) { if (! isset($this->originalCachePaths[$name])) { + // Only scope stores captured during bootstrap. If one was added to tenancy.cache.stores + // mid-request, it has no original path here -- reading it would throw when tenancy ends. continue; }