mirror of
https://github.com/archtechx/tenancy.git
synced 2026-05-07 02:04:04 +00:00
Merge branch 'master' into add-log-bootstrapper
This commit is contained in:
commit
fa075ef187
4 changed files with 18 additions and 4 deletions
|
|
@ -4,6 +4,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Stancl\Tenancy\Bootstrappers;
|
||||
|
||||
use Exception;
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Session\FileSessionHandler;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
|
@ -75,8 +76,13 @@ class FilesystemTenancyBootstrapper implements TenancyBootstrapper
|
|||
: $this->originalStoragePath . '/framework/cache';
|
||||
|
||||
if (! is_dir($path)) {
|
||||
// Create tenant framework/cache directory if it does not exist
|
||||
mkdir($path, 0750, true);
|
||||
// Create tenant framework/cache directory if it does not exist.
|
||||
// We ignore errors due to TOCTOU race conditions, instead we check for success below.
|
||||
@mkdir($path, 0750, true);
|
||||
|
||||
if (! is_dir($path)) {
|
||||
throw new Exception("Unable to create tenant storage directory [{$path}].");
|
||||
}
|
||||
}
|
||||
|
||||
if ($suffix === false) {
|
||||
|
|
@ -222,8 +228,13 @@ class FilesystemTenancyBootstrapper implements TenancyBootstrapper
|
|||
: $this->originalStoragePath . '/framework/sessions';
|
||||
|
||||
if (! is_dir($path)) {
|
||||
// Create tenant framework/sessions directory if it does not exist
|
||||
mkdir($path, 0750, true);
|
||||
// Create tenant framework/sessions directory if it does not exist.
|
||||
// We ignore errors due to TOCTOU race conditions, instead we check for success below.
|
||||
@mkdir($path, 0750, true);
|
||||
|
||||
if (! is_dir($path)) {
|
||||
throw new Exception("Unable to create tenant session directory [{$path}].");
|
||||
}
|
||||
}
|
||||
|
||||
$this->app['config']['session.files'] = $path;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ use Illuminate\Database\Eloquent\Builder;
|
|||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Scope;
|
||||
|
||||
/** @implements Scope<Model> */
|
||||
class PendingScope implements Scope
|
||||
{
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ use Illuminate\Database\Eloquent\Builder;
|
|||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Scope;
|
||||
|
||||
/** @implements Scope<Model> */
|
||||
class ParentModelScope implements Scope
|
||||
{
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||
use Illuminate\Database\Eloquent\Scope;
|
||||
use Stancl\Tenancy\Tenancy;
|
||||
|
||||
/** @implements Scope<Model> */
|
||||
class TenantScope implements Scope
|
||||
{
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue