Skip to content
This repository has been archived by the owner on Mar 9, 2024. It is now read-only.

Restore $wpdb->use_mysqli for backward compatibility #220

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/wp-includes/class-wpdb.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
10 changes: 10 additions & 0 deletions tests/phpunit/tests/db.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
}
Loading