diff --git a/memcache.inc b/memcache.inc index ed511a6..77facc6 100644 --- a/memcache.inc +++ b/memcache.inc @@ -18,12 +18,15 @@ class MemCacheDrupal implements DrupalCacheInterface { // If page_cache_without_database is enabled, we have to manually load the // $conf array out of cache_bootstrap. - static $bootstrapped = FALSE; - if (isset($GLOBALS['conf']['page_cache_without_database']) && $GLOBALS['conf']['page_cache_without_database'] == TRUE && !$bootstrapped) { + static $variables_loaded = FALSE; + if (!empty($GLOBALS['conf']['page_cache_without_database']) && !$variables_loaded) { global $conf; - $bootstrapped = TRUE; + $variables_loaded = TRUE; + // Try loading variables from cache. If that fails, we have to bootstrap + // further in order to fetch them. if ($cached = cache_get('variables', 'cache_bootstrap')) { $variables = $cached->data; + // Make sure variable overrides are applied, see variable_initialize(). foreach ($conf as $name => $value) { $variables[$name] = $value; } @@ -31,7 +34,6 @@ class MemCacheDrupal implements DrupalCacheInterface { } else { drupal_bootstrap(DRUPAL_BOOTSTRAP_VARIABLES, FALSE); - _drupal_bootstrap_page_cache(); } }