mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 18:44:03 +00:00
Features refactor
Features are now *always* bootstrapped, even if Tenancy is not resolved from the container. Previous implementations include https://github.com/tenancy-for-laravel/v4/pull/19 https://github.com/archtechx/tenancy/pull/1021 Bug originally reported here https://github.com/archtechx/tenancy/issues/949 This implementation is much simpler, we do not distinguish between features that should be "always bootstrapped" and features that should only be bootstrapped after Tenancy is resolved. All features should work without issues if they're bootstrapped when TSP::boot() is called. We also add a Tenancy::bootstrapFeatures() method that can be used to bootstrap any features dynamically added at runtime that weren't bootstrapped in TSP::boot(). The function keeps track of which features were already bootstrapped so it doesn't bootstrap them again. The only potentialy risky thing in this implementation is that we're now resolving Tenancy in TSP::boot() (previously Tenancy was not being resolved) but that shouldn't be causing any issues.
This commit is contained in:
parent
33e4a8e4e2
commit
4578c9ed7d
15 changed files with 80 additions and 45 deletions
|
|
@ -94,6 +94,7 @@ class SQLiteDatabaseManager implements TenantDatabaseManager
|
|||
return false;
|
||||
}
|
||||
|
||||
// todo@sqlite we can just respect Laravel config for WAL now
|
||||
if (static::$WAL) {
|
||||
$pdo = new PDO('sqlite:' . $path);
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
|
|
@ -123,6 +124,7 @@ class SQLiteDatabaseManager implements TenantDatabaseManager
|
|||
}
|
||||
|
||||
try {
|
||||
// todo@sqlite we should also remove any other files for the DB e.g. WAL
|
||||
return unlink($this->getPath($name));
|
||||
} catch (Throwable) {
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue