Make WordPress Core


Ignore:
Timestamp:
02/25/2014 03:52:48 PM (10 years ago)
Author:
nacin
Message:

Use mysqli for WordPress development versions, regardless of PHP version, to increase testing footprint.

Allow the lack of ext/mysql to pass wp_check_php_mysql_versions().

see #21663.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/wp-db.php

    r27250 r27257  
    569569            $this->show_errors();
    570570
    571         $this->use_mysqli = ( version_compare( phpversion(), '5.5', '>=' ) && function_exists( 'mysqli_connect' ) );
     571        /* Use ext/mysqli if it exists and:
     572         *  - We are a development version of WordPress, or
     573         *  - We are running PHP 5.5 or greater, or
     574         *  - ext/mysql is not loaded.
     575         */
     576        if ( function_exists( 'mysqli_connect' ) ) {
     577            if ( version_compare( phpversion(), '5.5', '>=' ) || ! function_exists( 'mysql_connect' ) ) {
     578                $this->use_mysqli = true;
     579            } elseif ( false !== strpos( $GLOBALS['wp_version'], '-' ) ) {
     580                $this->use_mysqli = true;
     581            }
     582        }
    572583
    573584        $this->init_charset();
Note: See TracChangeset for help on using the changeset viewer.