Changeset 47451
- Timestamp:
- 03/12/2020 03:53:01 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/wp-db.php
r47230 r47451 3611 3611 * @since 2.7.0 3612 3612 * 3613 * @return null|string Null on failure, version number on success.3613 * @return string|null Version number on success, null on failure. 3614 3614 */ 3615 3615 public function db_version() { 3616 return preg_replace( '/[^0-9.].*/', '', $this->db_server_info() ); 3617 } 3618 3619 /** 3620 * Retrieves full MySQL server information. 3621 * 3622 * @since 5.5.0 3623 * 3624 * @return string|false Server info on success, false on failure. 3625 */ 3626 public function db_server_info() { 3616 3627 if ( $this->use_mysqli ) { 3617 3628 $server_info = mysqli_get_server_info( $this->dbh ); … … 3619 3630 $server_info = mysql_get_server_info( $this->dbh ); 3620 3631 } 3621 return preg_replace( '/[^0-9.].*/', '', $server_info ); 3632 3633 return $server_info; 3622 3634 } 3623 3635 } -
trunk/tests/phpunit/tests/db/charset.php
r47198 r47451 30 30 self::$_wpdb = new WpdbExposedMethodsForTesting(); 31 31 32 if ( self::$_wpdb->use_mysqli ) { 33 self::$server_info = mysqli_get_server_info( self::$_wpdb->dbh ); 34 } else { 35 self::$server_info = mysql_get_server_info( self::$_wpdb->dbh ); 36 } 32 self::$server_info = self::$_wpdb->db_server_info(); 37 33 } 38 34
Note: See TracChangeset
for help on using the changeset viewer.