Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow customizing location of settings includes files #73

Open
rlhawk opened this issue Oct 30, 2024 · 1 comment
Open

Allow customizing location of settings includes files #73

rlhawk opened this issue Oct 30, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@rlhawk
Copy link

rlhawk commented Oct 30, 2024

Is your feature request related to a problem? Please describe.
The following files are included automatically, if they exist, in acquia-recommended.settings.php:

  1. DRUPAL_ROOT/sites/settings/global.settings.php
  2. DRUPAL_ROOT/sites/SITE_NAME/settings/includes.settings.php
  3. DRUPAL_ROOT/sites/settings/ci.settings.php
  4. DRUPAL_ROOT/sites/SITE_NAME/settings/ci.settings.php
  5. DRUPAL_ROOT/sites/settings/local.settings.php
  6. DRUPAL_ROOT/sites/SITE_NAME/settings/local.settings.php

The paths to these files are hard-coded to be inside the web root directory. Developers may want to customize the location of these files—to store them outside the web root for additional security, for instance—but there's no way to do that without modifying acquia-recommended.settings.php.

Describe the solution you'd like
It would be helpful if the location of settings includes files could be customized—by defining a setting in composer.json, perhaps. There would likely need to be two settings: One for the location of global settings files (1, 3, and 5) and another for site-specific settings files (2, 4, and 6). The default locations for the files could be their current locations.

The settings could be defined like this in composer.json:

    "extra": {
        "drupal-recommended-settings": {
            "settings-path-global": "{$drupal_root}/sites/settings",
            "settings-path-site": "{$drupal_root}/sites/{$site_name}/settings"
        },
    }

Describe alternatives you've considered
I am currently customizing the paths to the settings includes files by running a script that alters acquia-recommended.settings.php and deletes the files that are created in the webroot. The script is run on composer install and composer update. This feels like a hacky solution, though.

Additional context
No other context.

@rlhawk rlhawk added the enhancement New feature or request label Oct 30, 2024
@rlhawk
Copy link
Author

rlhawk commented Nov 2, 2024

I realize that, in addition to being available to the Composer plugin, the settings would need to be available at runtime, within Drupal, so they would also need to be defined somewhere else—in the main settings.php file, perhaps. This whole issue seems to be pretty complex, and unlikely to be implemented, but this issue can be a place to have a discussion about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant