mirror of
https://github.com/archtechx/tenancy.git
synced 2026-09-20 15:14:03 +00:00
Handle tenancy.cache.stores changes during revert
Also add a separate test ('scopeCache ignores changes to tenancy.cache.stores made in tenant context' ) -- the 'central cache is not lost when tenancy ends' covered the skipping mechanism partially, but having a separate test for the tenancy.cache.stores mid-tenant context changes is definitely cleaner and makes more sense.
This commit is contained in:
parent
597e48ec90
commit
8244e56618
2 changed files with 57 additions and 21 deletions
|
|
@ -193,7 +193,14 @@ class FilesystemTenancyBootstrapper implements TenancyBootstrapper
|
|||
return;
|
||||
}
|
||||
|
||||
foreach ($this->app['config']['tenancy.cache.stores'] as $name) {
|
||||
// On revert, restore exactly the stores captured during bootstrap -- not the current
|
||||
// (possibly mutated) tenancy.cache.stores. Otherwise, removing a store from that
|
||||
// config in tenant context would make revert() skip it (so the store would be stuck with a tenant-scoped path).
|
||||
$stores = $suffix !== false
|
||||
? $this->app['config']['tenancy.cache.stores']
|
||||
: array_keys($this->originalCachePaths);
|
||||
|
||||
foreach ($stores as $name) {
|
||||
$store = $this->app['config']["cache.stores.{$name}"];
|
||||
|
||||
// Only file stores have a path to scope. Skip stores that don't exist (null) or use another driver.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue