refactor deployment#610
Merged
simonLeary42 merged 4 commits intomainfrom Apr 6, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the deployment structure to support domain-specific configurations for templates, mail, and custom user mappings. The refactoring consolidates the UnityConfig class into a new UnityDeployment class that handles all deployment-related path resolution and configuration management.
Changes:
- Replaced
UnityConfigclass withUnityDeploymentclass that provides unified methods for resolving templates, mail templates, custom ID mappings, and configuration files with domain-specific override support - Restructured the deployment directory from separate
overrides/,mail_overrides/, andtemplates_overrides/directories to a unifieddomain_overrides/<domain>/structure - Updated all template and mail path references throughout the codebase to use the new
UnityDeployment::getTemplatePath()andUnityDeployment::getMailPath()methods
Reviewed changes
Copilot reviewed 26 out of 31 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| resources/lib/UnityDeployment.php | New class that consolidates deployment configuration and path resolution logic with domain-specific override support |
| resources/lib/UnityConfig.php | Removed old configuration class |
| resources/lib/UnityLDAP.php | Removed custom ID mappings logic (moved to UnityDeployment); removed unused RuntimeException import |
| resources/lib/UnityMailer.php | Updated to use UnityDeployment::getMailPath() for mail template resolution |
| resources/lib/utils.php | Removed getTemplatePath() function (moved to UnityDeployment) |
| resources/config.php | Simplified to use UnityDeployment::getConfig() instead of UnityConfig |
| resources/autoload.php | Updated to load UnityDeployment instead of UnityConfig |
| test/phpunit-bootstrap.php | Updated to load UnityDeployment instead of UnityConfig |
| webroot/index.php | Updated all template includes to use UnityDeployment::getTemplatePath() |
| webroot/panel/*.php | Updated all template includes to use UnityDeployment::getTemplatePath() |
| webroot/admin/*.php | Updated all template includes to use UnityDeployment::getTemplatePath() |
| deployment/README.md | New comprehensive documentation for the deployment directory structure |
| deployment/config.base.ini | Moved from defaults/config/config.ini.default and removed obsolete custom_user_mappings_dir setting |
| deployment/templates/example.php | Example placeholder for deployment-specific templates |
| deployment/mail/example.php | Example placeholder for deployment-specific mail templates |
| deployment/templates_overrides/README.md | Removed (replaced by deployment/README.md) |
| deployment/mail_overrides/README.md | Removed (replaced by deployment/README.md) |
| deployment/overrides/README.md | Removed (replaced by deployment/README.md) |
| deployment/config/README.md | Removed (replaced by deployment/README.md) |
| deployment/custom_user_mappings/README.md | Removed (replaced by deployment/README.md) |
| deployment/domain_overrides/*/config.ini | Updated domain-specific configurations to new structure |
| deployment/domain_overrides/phpunit/custom_user_mappings/test.csv | Moved from test/custom_user_mappings/ |
| .gitignore | Simplified to ignore only deployment/config/config.ini (but contains a bug - path is incorrect) |
| .pre-commit-config.yaml | Removed resources/config.php from exclusion list as it's now properly formatted |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d085b95 to
c788d32
Compare
Member
Author
|
be1cf60 to
3d194fc
Compare
Member
Author
|
Member
Author
|
|
19bffe5 to
4a28aa0
Compare
Member
Author
|
TODO can we have a test case for domain override template / mail? |
bd9847e to
5f4a085
Compare
rename UnityConfig -> UnityDeployment no more readme file in custom_user_mappings/ UnityDeployment:: mail_overrides -> mail fix missing phpunit custom user mappings file remove custom user mappings from deployment readme change back location of phpunit custom user mappings mail templates are .html.twig now remove duplicate line from gitignore remove unused gitignore changelog remove unnecessary gitignore sort remove more, sort more update changelog UnityMailer accept domain override mail fclose named argument fix pathnames no config/ look for mail in mail/ condense code ?: -> ?? reorder .gitignore put back util reorder functions revert
5f4a085 to
bb7d595
Compare
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 PR adds support for domain-specific
mailandtemplates.old structure:
new structure:
In the new structure, the redundant
config/directories are removed, anddeployment/maildeployment/templateshave matching names toresources/mailresources/templates.UnityConfigtoUnityDeploymentUnityLDAPtoUnityDeploymentMoved Functions
getTemplatePathgetCustomIDMappings