_theme_load_registry
- Versions
- 6 – 7
_theme_load_registry($theme, $base_theme = NULL, $theme_engine = NULL)
Get the theme_registry cache from the database; if it doesn't exist, build it.
Parameters
$theme The loaded $theme object as returned by list_themes().
$base_theme An array of loaded $theme objects representing the ancestor themes in oldest first order.
theme_engine The name of the theme engine.
Code
includes/theme.inc, line 251
<?php
function _theme_load_registry($theme, $base_theme = NULL, $theme_engine = NULL) {
// Check the theme registry cache; if it exists, use it.
$cache = cache_get("theme_registry:$theme->name", 'cache');
if (isset($cache->data)) {
$registry = $cache->data;
_theme_set_registry($registry);
}
else {
// If not, build one and cache it.
$registry = _theme_build_registry($theme, $base_theme, $theme_engine);
// Only persist this registry if all modules are loaded. This assures a
// complete set of theme hooks.
if (module_load_all(NULL)) {
_theme_save_registry($theme, $registry);
_theme_set_registry($registry);
}
}
}
?>Login or register to post comments 