1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 12:24:04 +00:00

Update stubs, add PHP 8.5 todo

Remove comments about shouldBeQueued(true) being preferable in
production as that isn't necessarily true anymore with pending tenants
(or even the absence of any "optimizations", they're all optional).
Using queued tenant creation also requires some code changes in the
tenant onboarding logic, so it is misleading to imply that it's a
switch that should simply be turned on in production.

Add DatabaseCacheBootstrapper to config.php as it was missing there.

Remove note about MailConfigBootstrapper needing forceRefresh in the
QueueTenancyBootstrapper as we now use a non-persistent queue
bootstrapper by default.
This commit is contained in:
Samuel Štancl 2025-09-01 21:09:47 +02:00
parent 211be22735
commit 3cf102ebd6
3 changed files with 6 additions and 3 deletions

View file

@ -57,7 +57,7 @@ class TenancyServiceProvider extends ServiceProvider
// Provision API keys, create S3 buckets, anything you want! // Provision API keys, create S3 buckets, anything you want!
])->send(function (Events\TenantCreated $event) { ])->send(function (Events\TenantCreated $event) {
return $event->tenant; return $event->tenant;
})->shouldBeQueued(false), // `false` by default, but you likely want to make this `true` in production. })->shouldBeQueued(false),
// Listeners\CreateTenantStorage::class, // Listeners\CreateTenantStorage::class,
], ],
@ -80,7 +80,7 @@ class TenancyServiceProvider extends ServiceProvider
Jobs\DeleteDatabase::class, Jobs\DeleteDatabase::class,
])->send(function (Events\TenantDeleted $event) { ])->send(function (Events\TenantDeleted $event) {
return $event->tenant; return $event->tenant;
})->shouldBeQueued(false), // `false` by default, but you probably want to make this `true` for production. })->shouldBeQueued(false),
], ],
Events\TenantMaintenanceModeEnabled::class => [], Events\TenantMaintenanceModeEnabled::class => [],

View file

@ -170,6 +170,7 @@ return [
Bootstrappers\DatabaseTenancyBootstrapper::class, Bootstrappers\DatabaseTenancyBootstrapper::class,
Bootstrappers\CacheTenancyBootstrapper::class, Bootstrappers\CacheTenancyBootstrapper::class,
// Bootstrappers\CacheTagsBootstrapper::class, // Alternative to CacheTenancyBootstrapper // Bootstrappers\CacheTagsBootstrapper::class, // Alternative to CacheTenancyBootstrapper
// Bootstrappers\DatabaseCacheBootstrapper::class, // Separates cache by DB rather than by prefix, must run after DatabaseTenancyBootstrapper
Bootstrappers\FilesystemTenancyBootstrapper::class, Bootstrappers\FilesystemTenancyBootstrapper::class,
Bootstrappers\QueueTenancyBootstrapper::class, Bootstrappers\QueueTenancyBootstrapper::class,
// Bootstrappers\RedisTenancyBootstrapper::class, // Note: phpredis is needed // Bootstrappers\RedisTenancyBootstrapper::class, // Note: phpredis is needed
@ -181,7 +182,7 @@ return [
// Bootstrappers\TenantConfigBootstrapper::class, // Bootstrappers\TenantConfigBootstrapper::class,
// Bootstrappers\RootUrlBootstrapper::class, // Bootstrappers\RootUrlBootstrapper::class,
// Bootstrappers\UrlGeneratorBootstrapper::class, // Bootstrappers\UrlGeneratorBootstrapper::class,
// Bootstrappers\MailConfigBootstrapper::class, // Note: Queueing mail requires using QueueTenancyBootstrapper with $forceRefresh set to true // Bootstrappers\MailConfigBootstrapper::class,
// Bootstrappers\BroadcastingConfigBootstrapper::class, // Bootstrappers\BroadcastingConfigBootstrapper::class,
// Bootstrappers\BroadcastChannelPrefixBootstrapper::class, // Bootstrappers\BroadcastChannelPrefixBootstrapper::class,

View file

@ -36,6 +36,8 @@ class DisallowSqliteAttach implements Feature
protected function loadExtension(PDO $pdo): bool protected function loadExtension(PDO $pdo): bool
{ {
// todo@php85 In PHP 8.5, we can use setAuthorizer() instead of loading an extension.
// However, this is currently blocked on https://github.com/phpredis/phpredis/issues/2688
static $loadExtensionSupported = method_exists($pdo, 'loadExtension'); static $loadExtensionSupported = method_exists($pdo, 'loadExtension');
if ((! $loadExtensionSupported) || if ((! $loadExtensionSupported) ||