1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 13:14:05 +00:00
Commit graph

14 commits

Author SHA1 Message Date
fadf1001f8
PHP 8.5 support
This commit adds support for building a docker image based on PHP 8.5
(RC). It also removes some unused code in tests that was triggering
deprecation warnings. For similar deprecation warnings coming from
testbench we have a temporary patch script until this is resolved
upstream.

This commit also adds logic to the DisallowSqliteAttach feature
leveraging the new native setAuthorizer() method, instead of loading
a compiled extension.

We also remove the unused `php` parameter from ci.yml
2025-10-20 01:44:24 +02:00
ecc3374293 [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>
2025-08-08 00:54:01 +02:00
eac88dcc2a contributing note about mssql on Apple Silicon 2025-02-19 12:38:35 +01:00
Samuel Štancl
eecf6f21c8
Cache prefixing logic rewrite, session scoping improvements, tests refactor (#43)
* Run cache tests on all supported drivers

* update ci healthcheck for memcached

* remove memcached healthcheck

* fix typos in test comments, expand internal.md [ci skip]

* add empty line [ci skip]

* switch to using $store->setPrefix()

* add dynamodb

* refactor try-finally to try-catch

* remove unnecessary clearResolvedInstances() call

* add dual Cache:: and cache() assertions

* add apc

* Flush APCu cache in test setup

* Revert "add dual Cache:: and cache() assertions"

This reverts commit a0bab162fbe2dd0d25e7056ceca4fb7ce54efc77.

* phpstan fix

* Add logic for scoping 'file' disks to FilesystemTenancyBootstrapper

* minor changes, add todos

* refactor how the session.connection is used in the DB session bootstrapper

* add session forgery prevention logic to the db session bootstrapper

* only use the fs bootstrapper for file disk in 'cache data is separated' dataset

* minor session scoping test changes

* Add session scoping logic to FilesystemTenancyBootstrapper, correctly update disk roots even with storage_path_tenancy disabled

* Fix code style (php-cs-fixer)

* update docblock

* make not-null check more explicit

* separate bootstrapper tests, fix swapped test names for two tests

* refactor cache bootstrapper tests

* resolve global cache todo

* expand tests: session separation tests, more filesystem separation assertions; change prefix_base-type config keys to templates/formats

* add apc session scoping test, various session separation bugfixes

* phpstan + minor logic fixes

* prefix_format -> prefix

* fix database session separation test

* revert composer.json changes, update laravel dependencies to expected next release

* only run session scoping logic in cache bootstrapper for redis, memcached, dynamodb, apc; update gitattributes

* tenancy.central_domains -> tenancy.identification.central_domains

* db session separation test: add datasets

---------

Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
2024-04-09 20:40:27 +02:00
Samuel Štancl
32a063b834
Laravel 11 support + Docker improvements (#29)
* wip

* bump jobpipeline dependency

* bump pest dependency

* fix composer.json syntax

* minor changes to docker setup

* more docker changes

* compact pest output, remove unnecessary env vars from composer.json

* minor pest tweaks

* mssql fix

* try enabling colors in CI

* try setting --columns=max for pest in CI

* try setting columns using env var instead of --columns in CI

* Revert "try setting columns using env var instead of --columns in CI"

This reverts commit eb3c177aefa97b0a3140d7f0e89c5012a854ff42.

* replace --compact with --no-progress

* try setting a hardcoded columns value in CI

* remove --columns (doesn't work), add back --compact

* try setting COLUMNS to a hardcoded value in CI

* remove alternative env syntax from CI

* fix PrefixCacheBootstrapperTest on L11, skip on L10

* add one more skip() call

* fix validate.yml

* Simplify schema dump, skip dump-related tests in L10

* Rename 'dump' table to 'example'

* Bring schema dump-related tests together, add comments

* Merge schema path-related tests into one, add comments

* Rename dataset parameter

---------

Co-authored-by: lukinovec <lukinovec@gmail.com>
2024-02-18 00:18:31 +01:00
Samuel Štancl
2a39b0526a Fix #998, properly replace ALL tenant_id literals 2022-11-10 16:44:52 +01:00
Samuel Štancl
b7a6953231 mention ./t in CONTRIBUTING.md 2022-11-04 15:17:54 +01:00
Samuel Štancl
8af354c20e get phpstan errors down from 252 to 189 2022-08-30 05:44:23 +02:00
Samuel Štancl
05f2a828a1 Better M1 DX 2022-07-22 22:29:56 +02:00
Samuel Štancl
5026f54a6d fix path prefixing 2022-03-23 20:48:55 +01:00
Dylan Harbour
e0af2e9945
Fix issue 521: Array input for --tenants (#522)
* Fix issue 521: Array input for `--tenants`

Tenancy for Laravel docs refer to using multiple `--tenants=<...> ` options when running a command for multiple tenants explicitly: https://tenancyforlaravel.com/docs/v3/console-commands

However, the command input is not defined correctly to receive arrays.
https://laravel.com/docs/7.x/artisan#input-arrays

This PR adds a failing test, fixes the issue and corrects a typo in the contributing readme.

* Styleci

Co-authored-by: Dylan Harbour <dylanh@ringier.co.za>
2020-11-12 14:08:37 +01:00
Samuel Štancl
02e049b59e Convert domains to lowercase, persist current domain model on resolver 2020-06-28 11:45:08 +02:00
Samuel Štancl
869ac32983
[2.2.0] [WIP] Add functionality (#206)
* TenantDatabaseDoesNotExistException

* Apply fixes from StyleCI

* User post-creation callbacks

* Rename method

* postCreationActions

* pass $tenant as parameter

* pass $tenant to async actions

* WIP findBy()

* findBy\* ForwardsCalls

* Apply fixes from StyleCI

* findBy DB storage driver

* Redis  SD TODO message

* Apply fixes from StyleCI

* Fix chained jobs

* WIP event system

* import str

* instanceof closure check

* findBy instead of find

* Tenant -> Tenants

* dots

* Use DB hooks instead of a SC key

* Don't allow  callables for queue chain

* CanDeleteKeys interface

* Apply fixes from StyleCI

* CanFindByAnyKey interface

* Apply fixes from StyleCI

* Ditch models for custom repositories

* Resolve circular dependency

* Apply fixes from StyleCI

* Fix tests

* Apply fixes from StyleCI

* FutureTest

* Prefix tenant events with 'tenant.'

* Event listener arguments test
2019-10-27 21:10:41 +01:00
Samuel Štancl
a31a76cb37
Create CONTRIBUTING.md 2019-09-22 19:25:30 +02:00