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;
}
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 2994152-8.patch | 2.3 KB | shubham.prakash |
| #2 | extension_discovery_include_directory-2994152-2.patch | 2.47 KB | alexandrdnlv |
Comments
Comment #2
alexandrdnlv commentedSuggested patch attached.
Comment #3
alexandrdnlv commentedComment #4
dawehner@alexandrdnlv If you provide an issue summary like that it would be nice to explain WHY you need some specific feature. For the thing you want to achieve, there might be a better solution out there.
Comment #5
alexandrdnlv commentedUpdated a bit issue summary with example use case.
Comment #7
andypostComment #8
shubham.prakash commentedThis patch should apply cleanly.
Comment #16
smustgrave commentedThis 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.