mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 19:14:04 +00:00
Create tenant storage directories in FilesystemTenancyBootstrapper (#1410)
This is because the CreateTenantStorage listener only runs when a tenant is created, but in multi-server setups the directory may need to be created each time a tenant is *used*, not just created. Also changed the listeners to use TenantEvent instead of specific events, to make it possible to use them with other events, such as TenancyBootstrapped. Also update permission bits in a few mkdir() calls to better scope data to the current OS user. Also fix a typo in CacheTenancyBootstrapper (exception message).
This commit is contained in:
parent
0ef4dfd230
commit
cab8ecebec
6 changed files with 45 additions and 7 deletions
|
|
@ -78,6 +78,15 @@ class FilesystemTenancyBootstrapper implements TenancyBootstrapper
|
|||
return;
|
||||
}
|
||||
|
||||
$path = $suffix
|
||||
? $this->tenantStoragePath($suffix) . '/framework/cache'
|
||||
: $this->originalStoragePath . '/framework/cache';
|
||||
|
||||
if (! is_dir($path)) {
|
||||
// Create tenant framework/cache directory if it does not exist
|
||||
mkdir($path, 0750, true);
|
||||
}
|
||||
|
||||
if ($suffix === false) {
|
||||
$this->app->useStoragePath($this->originalStoragePath);
|
||||
} else {
|
||||
|
|
@ -211,7 +220,7 @@ class FilesystemTenancyBootstrapper implements TenancyBootstrapper
|
|||
|
||||
if (! is_dir($path)) {
|
||||
// Create tenant framework/sessions directory if it does not exist
|
||||
mkdir($path, 0755, true);
|
||||
mkdir($path, 0750, true);
|
||||
}
|
||||
|
||||
$this->app['config']['session.files'] = $path;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue