diff --git a/src/wp-includes/class-wpdb.php b/src/wp-includes/class-wpdb.php index 87dbe06c32..545286cfd1 100644 --- a/src/wp-includes/class-wpdb.php +++ b/src/wp-includes/class-wpdb.php @@ -690,6 +690,16 @@ class wpdb { */ private $allow_unsafe_unquoted_parameters = true; + /** + * Whether to use mysqli over mysql. Default false. + * + * @since 3.9.0 + * @since CP-2.0.0 Defaults to true for backward compatibility. + * + * @var bool + */ + private $use_mysqli = true; + /** * Whether we've managed to successfully connect at some point. * diff --git a/tests/phpunit/tests/db.php b/tests/phpunit/tests/db.php index 5b921d8a7f..166ff858ae 100644 --- a/tests/phpunit/tests/db.php +++ b/tests/phpunit/tests/db.php @@ -2469,4 +2469,14 @@ public function parse_db_host_data_provider() { ), ); } + + /** + * The wpdb->use_mysqli is true (for now), purely for backwards compatibility reasons. + */ + public function test_mysqli_is_set() { + global $wpdb; + + $this->assertObjectHasAttribute( 'use_mysqli', $wpdb ); + $this->assertTrue( $wpdb->use_mysqli ); + } }