Make WordPress Core

Ticket #21663: 21663.13.diff

File 21663.13.diff, 977 bytes (added by nacin, 11 years ago)
  • src/wp-includes/wp-db.php

     
    569569                        $this->show_errors();
    570570
    571571                /* Use ext/mysqli if it exists and:
     572                 *  - USE_EXT_MYSQL is defined as false, or
    572573                 *  - We are a development version of WordPress, or
    573574                 *  - We are running PHP 5.5 or greater, or
    574575                 *  - ext/mysql is not loaded.
    575576                 */
    576577                if ( function_exists( 'mysqli_connect' ) ) {
    577                         if ( version_compare( phpversion(), '5.5', '>=' ) || ! function_exists( 'mysql_connect' ) ) {
     578                        if ( defined( 'USE_EXT_MYSQL' ) ) {
     579                                $this->use_mysqli = (bool) USE_EXT_MYSQL;
     580                        } elseif ( version_compare( phpversion(), '5.5', '>=' ) || ! function_exists( 'mysql_connect' ) ) {
    578581                                $this->use_mysqli = true;
    579582                        } elseif ( false !== strpos( $GLOBALS['wp_version'], '-' ) ) {
    580583                                $this->use_mysqli = true;
    581                         }
    582584                }
    583585
    584586                $this->init_charset();