WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/20/2010 07:13:47 PM (9 years ago)
Author:
nacin
Message:

Always include wp-db.php. Prevents a conditional include and allows db dropins to cleanly extend the wpdb class. Move require_wp_db() to load.php for consistency with bootloader helpers. fixes #14508.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r15636 r15638  
    31023102
    31033103/**
    3104  * Load the correct database class file.
    3105  *
    3106  * This function is used to load the database class file either at runtime or by
    3107  * wp-admin/setup-config.php We must globalise $wpdb to ensure that it is
    3108  * defined globally by the inline code in wp-db.php.
    3109  *
    3110  * @since 2.5.0
    3111  * @global $wpdb WordPress Database Object
    3112  */
    3113 function require_wp_db() {
    3114     global $wpdb;
    3115     if ( file_exists( WP_CONTENT_DIR . '/db.php' ) )
    3116         require_once( WP_CONTENT_DIR . '/db.php' );
    3117     else
    3118         require_once( ABSPATH . WPINC . '/wp-db.php' );
    3119 }
    3120 
    3121 /**
    31223104 * Load custom DB error or display WordPress DB error.
    31233105 *
Note: See TracChangeset for help on using the changeset viewer.