Allow to extend search directories in Drupal\Core\Extension\ExtensionDiscovery

Created on 21 August 2018, almost 6 years ago
Updated 2 February 2023, over 1 year ago

Problem/Motivation

It is not possible to extend Drupal\Core\Extension\ExtensionDiscovery's scan directories in case you need to put yours extension to non-default location.

Example use case
When you may need to have a lot of groups of modules&themes (100+), in a specific folders, with a single profile, and in single repository (without submodules): it helps to restrict access to specific categories of extensions to different groups of developers. Default extension directories are in read-only mode.

Example directory structure:

root/some_folder
                ├──group1
                        ├──modules
                        ├──themes
                ├──group2
                        ├──modules
                        ├──themes

Proposed resolution

Allow to extend scan directories via adding $settings['extension_discovery_include_directory'] = 'some/folder'; in settings.php

We can extend Drupal\Core\Extension\ExtensionDiscovery, scan method:

    // Allow to extend search directories via settings.php.
    if ($include_directory = Settings::get('extension_discovery_include_directory')) {
      $searchdirs[static::ORIGIN_INCLUDE_DIRECTORY] = $include_directory;
    }
✨ Feature request
Status

Needs work

Version

10.1 ✨

Component
Extension  →

Last updated 3 days ago

No maintainer
Created by

🇧🇬Bulgaria alexandrdnlv

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States smustgrave

    This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request → as a guide.

    This was previously tagged or issue summary update which still need to happen.

    Even though majority of this patch is comments think it will still need a test case to show it working.

    Thanks.

Production build 0.69.0 2024