Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The schema cache is never used on runtime, but every time we install a module, we do a rebuild of it. This takes about 500kb of memory.
Proposed resolution
Just delete the cache item instead.
Remaining tasks
User interface changes
N/A.
API changes
N/A.
Comment | File | Size | Author |
---|---|---|---|
#19 | remove_drupal_get_schema.patch | 9.02 KB | catch |
#15 | 2502373.patch | 9.57 KB | catch |
#12 | interdiff-2502373-10-12.txt | 1.68 KB | umarzaffer |
#12 | 2502373-12.patch | 10.21 KB | umarzaffer |
#10 | 2502373.patch | 7.99 KB | catch |
Comments
Comment #1
catchComment #3
catchBackslash.
Comment #4
catchComment #6
catchLet's drop the static cache. This isn't used anywhere in core outside tests and install-related code:
Comment #8
catchRemoving some cruft and updating some more calls.
Comment #10
catchComment #12
umarzaffer CreditAttribution: umarzaffer at Srijan | A Material+ Company commentedFixing failing tests.
Comment #14
catchNamespacing isn't the problem here. The direct calls to hook_install() relied on drupal_get_schema(NULL, TRUE) having loaded all module install files. We need to load the install files explciitly instead - either in a base test class or just before calling the hook_install() (I didn't look at the individual tests yet).
Comment #15
catchHere it is with that change.
Comment #16
no_angel CreditAttribution: no_angel as a volunteer commentedComment #17
no_angel CreditAttribution: no_angel as a volunteer commentedI need to fix:
Xdebug settings xdebug.max_nesting_level is set to 100.
Set xdebug.max_nesting_level=256 in your PHP configuration as some pages in your Drupal site will not work when this setting is too low.
before testing.
Comment #18
no_angel CreditAttribution: no_angel as a volunteer commentedComment #19
catchRemembered from another issue, that drupal_get_schema() is exclusively used in tests now. So here's a patch to completely remove it.
Major since this is both time and memory, and it will get worse the more modules are on a site (if they implement hook_schema()).
Comment #21
catch#2451395: drupal_get_schema()/drupal_get_complete_schema() no longer work as expected; remove them.