Problem/Motivation
Why do we sometimes not use the infoParser?
Let's remove that option and always use it.
Steps to reproduce
N/A
Proposed resolution
Remove the use_info_parser parameter.
I only see usage in tests and core, I propose we do a hard break here since it's in the middle.
We can create an issue in the 4 projects that even set it.
Remaining tasks
Determine if we need to deprecate it or can just remove it, a few contrib do change the default:
https://git.drupalcode.org/project/ai/-/blob/68de4bcc381e8abec865fed5485...
https://git.drupalcode.org/project/automatic_updates/-/blob/5c41897b0992...
https://git.drupalcode.org/project/raw_fields_formatters/-/blob/423e2dd5...
https://git.drupalcode.org/project/eme/-/blob/6e292468d5a726233d2324e786...
They are all tests, I can create an issue in each.
https://search.tresbien.tech/search?q=ExtensionDiscovery%20-r%3Adrupal
User interface changes
N/A
Introduced terminology
N/A
API changes
Technically now name and core_version_requirement are now always required.
The parameters changed for ExtensionDiscovery
info.yml caches earlier in FileCache
Data model changes
N/A
Release notes snippet
N/A
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | Screenshot from 2026-08-22 11-49-00.png | 425 KB | catch |
| #16 | Screenshot from 2026-08-22 11-45-24.png | 431.37 KB | catch |
Issue fork drupal-3618545
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
nicxvan commentedComment #5
nicxvan commentedComment #6
nicxvan commentedComment #7
nicxvan commentedComment #8
nicxvan commentedDo we need a CR for this?
Comment #9
nitinkumar_7 commentedThis removes the $use_info_parser = FALSE path and makes InfoParser mandatory, so ExtensionDiscovery::scan() now always parses the complete .info.yml file instead of using the previous lightweight type: lookup. Could we add or extend a test covering the discovery behavior that previously used $use_info_parser = FALSE, to make sure there isn't an unintended behavioral or performance regression?
Comment #10
nitinkumar_7 commentedAlso, since the ExtensionDiscovery constructor signature is changing, this looks like a public API change. Could we confirm whether a change record is needed for this?
Comment #11
catchConstructors are considered @internal but we should add a change record anyway probably.
Comment #12
alexpottWe're going to need to consider the performance ramifications of this change. I'm pretty sure this exists to stop thousands of yaml reads during install.
Comment #13
catchWe do a lot of YAML info parsing during install already, per #3616275: Use the PECL YAML parser for info file parsing when available although yes it would be good to check how much, if any, this adds on top of that.
But last time I looked at this (some time ago around #3493423: Deprecate the $use_info_parser parameter to ExtensionParser::scanDirectory()) we were often doing the custom parsing once and then parsing the YAML again in the same request.
Comment #14
alexpottOn a minimum install using Drush
HEAD
MR
So we're using more function calls and and more memory - what is the motivation behind this change other than less options in the constructor?
Comment #15
alexpottIf we add this MR plus the pecl yaml together we get
So less function calls - which makes sense - but still the increased memory usage...
Comment #16
catchDid some quick profiling.
I hacked GenericTestBase to do an early return, and then node module's GenericTest with HEAD vs. the MR with xhprof enabled. The MR adds only two calls to Yaml::decode()
1324 in HEAD and 1326 with the MR.
Comment #17
catchThe different profiling results are interesting. I'm wondering how much this is the real installer vs running a functional test, or whether drush is also doing some extension parsing itself to find plugins etc. Once way to find out would be to compare drush to dr install I guess (or look at the specifics of what's calling this from drush).
Note there's also #3303751: Reduce the number of times UpdateRegistry scans for extensions which is postponed on this issue.
Comment #18
catchComment #19
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #20
nicxvan commentedRebased, updated the call in
UpdateRegistry