function system_rebuild_module_data
Same name in other branches
- 7.x modules/system/system.module \system_rebuild_module_data()
Rebuild, save, and return data about all currently available modules.
Return value
\Drupal\Core\Extension\Extension[] Array of all available modules and their data.
Deprecated
in drupal:8.8.0 and is removed from drupal:9.0.0. Use \Drupal::service('extension.list.module')->getList() instead. Note: use reset() only when you really need to rescan and rebuild the list.
See also
https://www.drupal.org/node/2709919
1 call to system_rebuild_module_data()
- SystemFunctionsLegacyTest::testSystemRebuildModuleDataDeprecation in core/
modules/ system/ tests/ src/ Kernel/ SystemFunctionsLegacyTest.php - @expectedDeprecation system_rebuild_module_data() is deprecated in Drupal 8.8.0 and will be removed before Drupal 9.0.0. Instead, you should use \Drupal::service("extension.list.module")->getList(). See https://www.drupal.org/node/2709919
File
-
core/
modules/ system/ system.module, line 1019
Code
function system_rebuild_module_data() {
@trigger_error('system_rebuild_module_data() is deprecated in Drupal 8.8.0 and will be removed before Drupal 9.0.0. Instead, you should use \\Drupal::service("extension.list.module")->getList(). See https://www.drupal.org/node/2709919', E_USER_DEPRECATED);
return \Drupal::service('extension.list.module')->reset()
->getList();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.