Make WordPress Core

Changeset 27257


Ignore:
Timestamp:
02/25/2014 03:52:48 PM (11 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.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

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

    r25455 r27257  
    108108    }
    109109
    110     if ( ! extension_loaded( 'mysql' ) && ! file_exists( WP_CONTENT_DIR . '/db.php' ) ) {
     110    if ( ! extension_loaded( 'mysql' ) && ! extension_loaded( 'mysqli' ) && ! file_exists( WP_CONTENT_DIR . '/db.php' ) ) {
    111111        wp_load_translations_early();
    112112        die( __( 'Your PHP installation appears to be missing the MySQL extension which is required by WordPress.' ) );
  • 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.