From 3cf102ebd67a2b337857c99b953ba11b4ab1eb3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Mon, 1 Sep 2025 21:09:47 +0200 Subject: [PATCH] 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. --- assets/TenancyServiceProvider.stub.php | 4 ++-- assets/config.php | 3 ++- src/Features/DisallowSqliteAttach.php | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/assets/TenancyServiceProvider.stub.php b/assets/TenancyServiceProvider.stub.php index 1a01e9a8..e0b69e6e 100644 --- a/assets/TenancyServiceProvider.stub.php +++ b/assets/TenancyServiceProvider.stub.php @@ -57,7 +57,7 @@ class TenancyServiceProvider extends ServiceProvider // Provision API keys, create S3 buckets, anything you want! ])->send(function (Events\TenantCreated $event) { return $event->tenant; - })->shouldBeQueued(false), // `false` by default, but you likely want to make this `true` in production. + })->shouldBeQueued(false), // Listeners\CreateTenantStorage::class, ], @@ -80,7 +80,7 @@ class TenancyServiceProvider extends ServiceProvider Jobs\DeleteDatabase::class, ])->send(function (Events\TenantDeleted $event) { return $event->tenant; - })->shouldBeQueued(false), // `false` by default, but you probably want to make this `true` for production. + })->shouldBeQueued(false), ], Events\TenantMaintenanceModeEnabled::class => [], diff --git a/assets/config.php b/assets/config.php index 1eee26f0..d01cbff7 100644 --- a/assets/config.php +++ b/assets/config.php @@ -170,6 +170,7 @@ return [ Bootstrappers\DatabaseTenancyBootstrapper::class, Bootstrappers\CacheTenancyBootstrapper::class, // 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\QueueTenancyBootstrapper::class, // Bootstrappers\RedisTenancyBootstrapper::class, // Note: phpredis is needed @@ -181,7 +182,7 @@ return [ // Bootstrappers\TenantConfigBootstrapper::class, // Bootstrappers\RootUrlBootstrapper::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\BroadcastChannelPrefixBootstrapper::class, diff --git a/src/Features/DisallowSqliteAttach.php b/src/Features/DisallowSqliteAttach.php index 3d4d977e..fbfa8e58 100644 --- a/src/Features/DisallowSqliteAttach.php +++ b/src/Features/DisallowSqliteAttach.php @@ -36,6 +36,8 @@ class DisallowSqliteAttach implements Feature 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'); if ((! $loadExtensionSupported) ||