Skip to content

refactor deployment#610

Draft
simonLeary42 wants to merge 2 commits intomainfrom
refactor-overrides
Draft

refactor deployment#610
simonLeary42 wants to merge 2 commits intomainfrom
refactor-overrides

Conversation

@simonLeary42
Copy link
Member

@simonLeary42 simonLeary42 commented Feb 11, 2026

This PR adds support for domain-specific mail and templates.

old structure:

defaults/
    config/
        config.ini.default
deployment/
    config/
        config.ini
    custom_user_mappings/
        example.csv
    mail_overrides/
        example.php
    templates_overrides/
        example.php
    overrides/
        foobar/
            config/
                config.ini

new structure:

deployment/
    config.base.ini
    config.ini
    custom_user_mappings/
        example.csv
    mail/
        example.php
    templates/
        example.php
    domain_overrides/
        foobar/
            config.ini
            mail/
                example.php
            templates/
                example.php

In the new structure, the redundant config/ directories are removed, and deployment/mail deployment/templates have matching names to resources/mail resources/templates.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 UnityConfig class with UnityDeployment class 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/, and templates_overrides/ directories to a unified domain_overrides/<domain>/ structure
  • Updated all template and mail path references throughout the codebase to use the new UnityDeployment::getTemplatePath() and UnityDeployment::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.

@simonLeary42 simonLeary42 force-pushed the refactor-overrides branch 4 times, most recently from caef51f to d085b95 Compare February 11, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants