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

[4.x] Support database cache store tenancy (#1290) (resolve #852)

* Initial implementation (lukinovec)

* Make sure DatabaseCacheBootstrapper runs after DatabaseTenancyBootstrapper, misc wip changes

* Fix withTenantDatabases()

* Add failing test (GlobalCacheTest)

* Configure globalCache's DB stores to use central connection instead of default connection every time it's reinstantiated

* Make GlobalCache facade not cached. Even though it wasn't causing issues
in our existing tests, it likely was flaky, and making it not $cached
makes it now consistent with global_cache() - always getting a new
CacheManager from the globalCache container binding

* Add database connection assertions in GlobalCacheTest

* Run all cached resolver/global cache tests with DatabaseCacheBootstrapper

* Reset adjustCacheManagerUsing in revert() and TestCase

* Reset static $stores property

* Finalize GlobalCache-related changes

* tests: remove pointless cache TTLs

* Refactor DatabaseCacheBootstrapper

* Refactor tests

Co-authored-by: lukinovec <lukinovec@gmail.com>
This commit is contained in:
Samuel Štancl 2025-08-08 00:54:01 +02:00
parent 3984d64cfa
commit ecc3374293
14 changed files with 600 additions and 38 deletions

View file

@ -63,7 +63,14 @@
"docker-up": "docker compose up -d",
"docker-down": "docker compose down",
"docker-restart": "docker compose down && docker compose up -d",
"docker-rebuild": "PHP_VERSION=8.4 docker compose up -d --no-deps --build",
"docker-rebuild": [
"Composer\\Config::disableProcessTimeout",
"PHP_VERSION=8.4 docker compose up -d --no-deps --build"
],
"docker-rebuild-with-xdebug": [
"Composer\\Config::disableProcessTimeout",
"PHP_VERSION=8.4 XDEBUG_ENABLED=true docker compose up -d --no-deps --build"
],
"docker-m1": "ln -s docker-compose-m1.override.yml docker-compose.override.yml",
"testbench-unlink": "rm ./vendor/orchestra/testbench-core/laravel/vendor",
"testbench-link": "ln -s /var/www/html/vendor ./vendor/orchestra/testbench-core/laravel/vendor",
@ -72,10 +79,22 @@
"phpstan": "vendor/bin/phpstan --memory-limit=256M",
"phpstan-pro": "vendor/bin/phpstan --memory-limit=256M --pro",
"cs": "PHP_CS_FIXER_IGNORE_ENV=1 php-cs-fixer fix --config=.php-cs-fixer.php",
"test": "./test --no-coverage",
"test-full": "./test",
"act": "act -j tests --matrix 'laravel:^11.0'",
"act-input": "act -j tests --matrix 'laravel:^11.0' --input"
"test": [
"Composer\\Config::disableProcessTimeout",
"./test --no-coverage"
],
"test-full": [
"Composer\\Config::disableProcessTimeout",
"./test"
],
"act": [
"Composer\\Config::disableProcessTimeout",
"act -j tests --matrix 'laravel:^11.0'"
],
"act-input": [
"Composer\\Config::disableProcessTimeout",
"act -j tests --matrix 'laravel:^11.0' --input"
]
},
"minimum-stability": "dev",
"prefer-stable": true,