summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-09-13 15:09:45 +0000
committerDries Buytaert <dries@buytaert.net>2009-09-13 15:09:45 +0000
commitb5cee8fe4945c0ebdc621f82992aa9b4eb698b0c (patch)
treecd9d3c1b7942ebc5e4bc8e0d8c63d4ea8f5a3518
parent4c49bf4a56fc489cf77ffeda493b4f2d13e25c8e (diff)
downloadbrdo-b5cee8fe4945c0ebdc621f82992aa9b4eb698b0c.tar.gz
brdo-b5cee8fe4945c0ebdc621f82992aa9b4eb698b0c.tar.bz2
- Patch #576096 by CorniI: use the new cache API.
-rw-r--r--includes/cache-install.inc26
-rw-r--r--install.php17
2 files changed, 23 insertions, 20 deletions
diff --git a/includes/cache-install.inc b/includes/cache-install.inc
index f342019f7..3ab41410d 100644
--- a/includes/cache-install.inc
+++ b/includes/cache-install.inc
@@ -10,19 +10,23 @@
* implementation during normal operations would have a negative impact
* on performance.
*/
+class DrupalFakeCache implements DrupalCacheInterface {
+ function __construct($bin) {
+ }
-function cache_get($key, $table = 'cache') {
- return FALSE;
-}
+ function get($cid) {
+ return FALSE;
+ }
-function cache_get_multiple(array &$cids, $bin = 'cache') {
- return array();
-}
+ function getMultiple(&$cids) {
+ return array();
+ }
-function cache_set($cid, $data, $table = 'cache', $expire = CACHE_PERMANENT, $headers = NULL) {
- return;
-}
-function cache_clear_all($cid = NULL, $table = NULL, $wildcard = FALSE) {
- return;
+ function set($cid, $data, $expire = CACHE_PERMANENT, array $headers = NULL) {
+ }
+
+ function clear($cid = NULL, $wildcard = FALSE) {
+ }
+
}
diff --git a/install.php b/install.php
index a49817b38..a52f9da1c 100644
--- a/install.php
+++ b/install.php
@@ -257,6 +257,13 @@ function install_begin_request(&$install_state) {
drupal_load('module', 'filter');
drupal_load('module', 'user');
+ // Load the cache infrastructure with the Fake Cache. Switch to the database cache
+ // later if possible.
+ require_once DRUPAL_ROOT . '/includes/cache.inc';
+ require_once DRUPAL_ROOT . '/includes/cache-install.inc';
+ $conf['cache_inc'] = 'includes/cache.inc';
+ $conf['cache_default_class'] = 'DrupalFakeCache';
+
// Prepare for themed output, if necessary. We need to run this at the
// beginning of the page request to avoid a different theme accidentally
// getting set.
@@ -271,8 +278,7 @@ function install_begin_request(&$install_state) {
// Since we have a database connection, we use the normal cache system.
// This is important, as the installer calls into the Drupal system for
// the clean URL checks, so we should maintain the cache properly.
- require_once DRUPAL_ROOT . '/includes/cache.inc';
- $conf['cache_inc'] = 'includes/cache.inc';
+ unset($conf['cache_default_class']);
// Initialize the database system. Note that the connection
// won't be initialized until it is actually requested.
@@ -282,13 +288,6 @@ function install_begin_request(&$install_state) {
$task = install_verify_completed_task();
}
else {
- // Since no persistent storage is available yet, and functions that check
- // for cached data will fail, we temporarily replace the normal cache
- // system with a stubbed-out version that short-circuits the actual
- // caching process and avoids any errors.
- require_once DRUPAL_ROOT . '/includes/cache-install.inc';
- $conf['cache_inc'] = 'includes/cache-install.inc';
-
$task = NULL;
// Since previous versions of Drupal stored database connection information