From cb52ddbf083bbe081cf2fd7fff0b223b67195550 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Wed, 26 Feb 2014 04:20:14 +0000 Subject: [PATCH] Add a constant to disable mysqli for testing purposes. see #21663. Built from https://develop.svn.wordpress.org/trunk@27278 git-svn-id: http://core.svn.wordpress.org/trunk@27134 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/wp-db.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php index 4bba086d3f..421db3671d 100644 --- a/wp-includes/wp-db.php +++ b/wp-includes/wp-db.php @@ -569,12 +569,15 @@ class wpdb { $this->show_errors(); /* Use ext/mysqli if it exists and: + * - USE_EXT_MYSQL is defined as false, or * - We are a development version of WordPress, or * - We are running PHP 5.5 or greater, or * - ext/mysql is not loaded. */ if ( function_exists( 'mysqli_connect' ) ) { - if ( version_compare( phpversion(), '5.5', '>=' ) || ! function_exists( 'mysql_connect' ) ) { + if ( defined( 'USE_EXT_MYSQL' ) ) { + $this->use_mysqli = ! USE_EXT_MYSQL; + } elseif ( version_compare( phpversion(), '5.5', '>=' ) || ! function_exists( 'mysql_connect' ) ) { $this->use_mysqli = true; } elseif ( false !== strpos( $GLOBALS['wp_version'], '-' ) ) { $this->use_mysqli = true;