As determined in #1808200-15: Unit test performance significantly decreased since system list config conversion:
change the entire function signature; first and foremost to remove the DRUPAL_PHP_FUNCTION_PATTERN from all callers and just have $dir and $extension, and only optionally $min_depth and $key in there
i.e., the resulting signature should look like this:
# The 99.9% use-case:
$modules = drupal_system_listing('modules');
$themes = drupal_system_listing('themes');
$profiles = drupal_system_listing('profiles');
# But still allow to override default parameters:
$modules = drupal_system_listing('modules', '.module', 0, 'uri');
$libraries = drupal_system_listing('libraries', '.info', 1, 'filename');
Additionally, consider to add a generic helper function to bootstrap.inc that returns a simple mapping array for core-supported directory names and file extensions — since this mapping is apparently repeated in drupal_get_filename()
.
Comment | File | Size | Author |
---|---|---|---|
#3 | drupal8.system-listing.3.patch | 11.05 KB | sun |
#2 | drupal8.system-listing.2.patch | 10.95 KB | sun |
Comments
Comment #1
sunComment #2
sunThis is what I had in mind.
Turns out that this allows us to simplify
drupal_get_filename()
andsimpletest_classloader_register()
already, so I'm no longer sure whether we need to factor out the mapping.Comment #3
sunFixed typos.
Comment #4.0
(not verified) CreditAttribution: commentedUpdated issue summary.
Comment #5
sunMade obsolete by #2188661: Extension System, Part II: ExtensionDiscovery