Only instantiate when DB_USER is defined

During setup, before wp-content.php is created and DB_USER is defined,
there is no way to instantiate it meaningfully.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
This commit is contained in:
Kevin Locke
2016-06-30 15:37:14 -07:00
parent 3a5afabcae
commit 2fc28e9bd8

View File

@ -34,5 +34,5 @@ define( 'WP_USE_EXT_MYSQL', true);
eval( str_replace( array_keys($replaces), array_values($replaces), file_get_contents(ABSPATH.'/wp-includes/wp-db.php')));
// Create wpdb object if not already done
if (! isset($wpdb))
if (! isset($wpdb) && defined('DB_USER'))
$wpdb = new wpdb2( DB_USER, DB_PASSWORD, DB_NAME, DB_HOST );