Ticket #14508: 14508.diff
File 14508.diff, 2.3 KB (added by , 14 years ago) |
---|
-
wp-includes/functions.php
3071 3071 } 3072 3072 3073 3073 /** 3074 * Load the correct database class file.3075 *3076 * This function is used to load the database class file either at runtime or by3077 * wp-admin/setup-config.php We must globalise $wpdb to ensure that it is3078 * defined globally by the inline code in wp-db.php.3079 *3080 * @since 2.5.03081 * @global $wpdb WordPress Database Object3082 */3083 function require_wp_db() {3084 global $wpdb;3085 if ( file_exists( WP_CONTENT_DIR . '/db.php' ) )3086 require_once( WP_CONTENT_DIR . '/db.php' );3087 else3088 require_once( ABSPATH . WPINC . '/wp-db.php' );3089 }3090 3091 /**3092 3074 * Load custom DB error or display WordPress DB error. 3093 3075 * 3094 3076 * If a file exists in the wp-content directory named db-error.php, then it will -
wp-includes/wp-db.php
1582 1582 } 1583 1583 } 1584 1584 1585 if ( ! isset( $wpdb ) ) {1586 /**1587 * WordPress Database Object, if it isn't set already in wp-content/db.php1588 * @global object $wpdb Creates a new wpdb object based on wp-config.php Constants for the database1589 * @since 0.711590 */1591 $wpdb = new wpdb( DB_USER, DB_PASSWORD, DB_NAME, DB_HOST );1592 }1593 1585 ?> -
wp-settings.php
67 67 require( ABSPATH . WPINC . '/functions.php' ); 68 68 require( ABSPATH . WPINC . '/classes.php' ); 69 69 70 // Include the wpdb class, or a db.php database drop-in if present. 71 require_wp_db(); 70 require_once( ABSPATH . WPINC . '/wp-db.php' ); 72 71 72 // Load custom db.php, if it exists 73 if ( file_exists( WP_CONTENT_DIR . '/db.php' ) ) 74 require_once( WP_CONTENT_DIR . '/db.php' ); 75 76 if ( ! isset( $wpdb ) ) { 77 /** 78 * WordPress Database Object, if it isn't set already in wp-content/db.php 79 * @global object $wpdb Creates a new wpdb object based on wp-config.php Constants for the database 80 * @since 0.71 81 */ 82 $wpdb = new wpdb( DB_USER, DB_PASSWORD, DB_NAME, DB_HOST ); 83 } 84 73 85 // Set the database table prefix and the format specifiers for database table columns. 74 86 wp_set_wpdb_vars(); 75 87