Add-feature/Add-automatic-tenant-resolver#77
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a comprehensive automatic tenant resolution system for multi-tenancy in Symfony applications, enabling seamless identification and switching of tenant contexts based on HTTP requests. The system supports multiple resolution strategies (subdomain, path, header, host, and chain), provides flexible configuration options, and integrates with the existing event-driven database switching mechanism. The most important changes are grouped below:
Automatic Tenant Resolution:
README.mddocumenting automatic tenant resolution, supported strategies, configuration examples, and custom resolver implementation.TenantResolutionListener, an event subscriber that resolves the tenant from HTTP requests and dispatchesSwitchDbEventautomatically.Configuration and Dependency Injection:
Configuration.phpto support tenant resolver settings, including strategy selection, options for each strategy, and exclusion paths.HakamMultiTenancyExtension.phpto register resolver services, configure the listener, and wire up strategy-specific resolvers based on user configuration. [1] [2]Resolver Implementations:
AbstractTenantResolveras a base class for resolvers, providing common option handling and interface implementation.ChainResolver(composite),HeaderResolver,HostResolver, andPathResolver, each extracting tenant information from different request parts. [1] [2] [3] [4]