mirror of
https://github.com/archtechx/tenancy.git
synced 2026-09-20 13:34:04 +00:00
Restore the central storage directory check in DeleteTenantStorage
The check compares the tenant's storage path with the bootstrapper's central storage path, so unlike the original one, it doesn't depend on storage_path(). With the current path resolution, the two can only be the same if suffix_base and the tenant's key are both empty, so this is just a safety net for weird configurations.
This commit is contained in:
parent
b771fd13a9
commit
1fb9acec75
1 changed files with 6 additions and 0 deletions
|
|
@ -35,6 +35,12 @@ class DeleteTenantStorage implements ShouldQueue
|
||||||
public function handle(): void
|
public function handle(): void
|
||||||
{
|
{
|
||||||
$tenantStoragePath = FilesystemTenancyBootstrapper::getBoundTenantStoragePath($this->tenant);
|
$tenantStoragePath = FilesystemTenancyBootstrapper::getBoundTenantStoragePath($this->tenant);
|
||||||
|
$centralStoragePath = FilesystemTenancyBootstrapper::getBoundCentralStoragePath();
|
||||||
|
|
||||||
|
if (realpath($tenantStoragePath) === realpath($centralStoragePath)) {
|
||||||
|
// Never delete the central storage directory -- that would delete the files of all tenants
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (is_dir($tenantStoragePath)) {
|
if (is_dir($tenantStoragePath)) {
|
||||||
File::deleteDirectory($tenantStoragePath);
|
File::deleteDirectory($tenantStoragePath);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue