Skip to content
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
4 changes: 0 additions & 4 deletions packages/mysql-on-sqlite/tests/fixtures/class-wpdb-stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ class WPDB_Stub {
public function add_placeholder_escape( $query ) {
return $query;
}

public function db_version() {
return preg_replace( '/[^0-9.].*/', '', $this->db_server_info() );
}
}

class_alias( WPDB_Stub::class, 'wpdb' );
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,21 @@ public function has_cap( $db_cap ) {
return parent::has_cap( $db_cap );
}

/**
* Retrieves the emulated database server version number.
*
* This mirrors wpdb::db_version(), but must also be defined here because
* WordPress 5.4 and older fetch server information directly from the MySQL
* extension instead of delegating to wpdb::db_server_info().
*
* @see wpdb::db_version()
*
* @return string Version number on success, or an empty string while disconnected.
*/
public function db_version() {
return preg_replace( '/[^0-9.].*/', '', $this->db_server_info() );
}

/**
* Returns the raw version string of the emulated MySQL server.
*
Expand Down
Loading