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.
By Berdir on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x
Introduced in version:
Issue links:
Description:
The function system_get_module_info() and the class that is used by it (ModuleInfo extends CacheArray) has been removed from Core.
It was introduced as a performant way to get a certain information from all module .info files, like the name and only existed in 8.x as it has not yet been backported.
There is no need anymore for this, as a lot of information has been removed from .info files so the problematic memory overhead no longer exists.
Before
$names = system_get_module_info('name');
After
$modules = system_get_info('module');
$names = array();
foreach ($modules as $name => $module) {
$names[$name] = $module['name'];
}
Impacts:
Site builders, administrators, editors