From bf8f8759736b35b9e79f8096fc9a5b4f25288a69 Mon Sep 17 00:00:00 2001
From: Tobias Stckler <tobiasstoeckler@googlemail.com>
Date: Mon, 17 Oct 2011 11:07:33 +0200
Subject: [PATCH] Use null cache for the installer.

---
 includes/install.core.inc |    4 +++-
 includes/path.null.inc    |   23 +++++++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletions(-)

diff --git a/includes/install.core.inc b/includes/install.core.inc
index 7405f9f..154408e 100644
--- a/includes/install.core.inc
+++ b/includes/install.core.inc
@@ -239,7 +239,9 @@ function install_begin_request(&$install_state) {
 
   // This must go after drupal_bootstrap(), which unsets globals!
   global $conf;
-
+  // Use fake path functions during installation to avoid trying
+  // to access database tables that are not yet installed.
+  $conf['path_inc'] = 'includes/path.null.inc';
   require_once DRUPAL_ROOT . '/modules/system/system.install';
   require_once DRUPAL_ROOT . '/includes/common.inc';
   require_once DRUPAL_ROOT . '/includes/file.inc';
diff --git a/includes/path.null.inc b/includes/path.null.inc
new file mode 100644
index 0000000..a741fee
--- /dev/null
+++ b/includes/path.null.inc
@@ -0,0 +1,23 @@
+<?php
+
+/**
+ * @file
+ * Functions to replace the real ones from path.inc while the installer is running.
+ */
+
+function drupal_path_initialize() {}
+function drupal_lookup_path($action, $path = '', $path_language = NULL) {}
+function drupal_cache_system_paths() {}
+function drupal_get_path_alias($path = NULL, $path_language = NULL) {}
+function drupal_get_normal_path($path, $path_language = NULL) {}
+function drupal_is_front_page() {}
+function drupal_match_path($path, $patterns) {}
+function current_path() {}
+function drupal_path_alias_whitelist_rebuild($source = NULL) {}
+function path_load($conditions) {}
+function path_save(&$path) {}
+function path_delete($criteria) {}
+function path_is_admin($path) {}
+function path_get_admin_paths() {}
+function drupal_valid_path($path, $dynamic_allowed = FALSE) {}
+function drupal_clear_path_cache($source = NULL) {}
-- 
1.5.6.5

