summaryrefslogtreecommitdiff
path: root/includes/bootstrap.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2008-11-02 06:33:56 +0000
committerDries Buytaert <dries@buytaert.net>2008-11-02 06:33:56 +0000
commita6a58c16ebf3907f28e16ee924704cce08a67774 (patch)
tree828a979b165beb08bd3e6c4aedea0a810ace5d71 /includes/bootstrap.inc
parentdc42384557cc93a2b5a7df25b75fef76dff15f58 (diff)
downloadbrdo-a6a58c16ebf3907f28e16ee924704cce08a67774.tar.gz
brdo-a6a58c16ebf3907f28e16ee924704cce08a67774.tar.bz2
- Patch #319394 by Crell: force the default database for registry queries.
Diffstat (limited to 'includes/bootstrap.inc')
-rw-r--r--includes/bootstrap.inc10
1 files changed, 8 insertions, 2 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index 55bf09574..c3f553793 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -1447,7 +1447,10 @@ function drupal_autoload_class($class) {
* Helper to check for a resource in the registry.
*/
function _registry_check_code($type, $name) {
- $file = db_query("SELECT filename FROM {registry} WHERE name = :name AND type = :type", array(
+ // This function may get called when the default database is not active, but
+ // there is no reason we'd ever want to not use the default database for
+ // this query.
+ $file = Database::getConnection('default')->query("SELECT filename FROM {registry} WHERE name = :name AND type = :type", array(
':name' => $name,
':type' => $type,
))
@@ -1507,7 +1510,10 @@ function registry_cache_path_files() {
$type_sql = array();
$params = array();
- $select = db_select('registry')->distinct();
+ // This function may get called when the default database is not active, but
+ // there is no reason we'd ever want to not use the default database for
+ // this query.
+ $select = Database::getConnection('default')->select('registry')->distinct();
$select->addField('registry', 'filename');
// This creates a series of 2-clause AND conditions that are then ORed together.