function module_implements_reset

Regenerates the stored list of hook implementations.

Related topics

8 calls to module_implements_reset()
DrupalUnitTestBase::enableModules in drupal/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php
Enables modules for this test.
drupal_install_system in drupal/core/includes/install.inc
Installs the system module.
LanguageNegotiationInfoTest::languageNegotiationUpdate in drupal/core/modules/language/lib/Drupal/language/Tests/LanguageNegotiationInfoTest.php
Update language types/negotiation information.
module_disable in drupal/core/includes/module.inc
Disables a given set of modules.
module_enable in drupal/core/includes/module.inc
Enables or installs a given list of modules.

... See full list

File

drupal/core/includes/module.inc, line 871
API for loading and interacting with Drupal modules.

Code

function module_implements_reset() {

  // We maintain a persistent cache of hook implementations in addition to the
  // static cache to avoid looping through every module and every hook on each
  // request. Benchmarks show that the benefit of this caching outweighs the
  // additional database hit even when using the default database caching
  // backend and only a small number of modules are enabled. The cost of the
  // cache('bootstrap')->get() is more or less constant and reduced further when
  // non-database caching backends are used, so there will be more significant
  // gains when a large number of modules are installed or hooks invoked, since
  // this can quickly lead to module_hook() being called several thousand times
  // per request.
  drupal_static_reset('module_implements');
  cache('bootstrap')
    ->set('module_implements', array());
  drupal_static_reset('module_hook_info');
  drupal_static_reset('drupal_alter');
  cache('bootstrap')
    ->delete('hook_info');
}