function registry_update in Drupal 7
Updates the registry based on the latest files listed in the database.
This function should be used when system_rebuild_module_data() does not need to be called, because it is already known that the list of files in the {system} table matches those in the file system.
Return value
TRUE if the registry was rebuilt, FALSE if another thread was rebuilding in parallel and the current thread just waited for completion.
See also
Related topics
3 calls to registry_update()
- module_disable in includes/
module.inc - Disables a given set of modules.
- module_enable in includes/
module.inc - Enables or installs a given list of modules.
- registry_rebuild in includes/
bootstrap.inc - Rescans all enabled modules and rebuilds the registry.
File
- includes/
bootstrap.inc, line 3549 - Functions that need to be loaded on every Drupal request.
Code
function registry_update() {
// install_system_module() calls module_enable() which calls into this
// function during initial system installation, so the lock system is neither
// loaded nor does its storage exist yet.
$in_installer = drupal_installation_attempted();
if (!$in_installer && !lock_acquire(__FUNCTION__)) {
// Another request got the lock, wait for it to finish.
lock_wait(__FUNCTION__);
return FALSE;
}
require_once DRUPAL_ROOT . '/includes/registry.inc';
_registry_update();
if (!$in_installer) {
lock_release(__FUNCTION__);
}
return TRUE;
}