Make WordPress Core

Ticket #18176: 18176.2.diff

File 18176.2.diff, 3.7 KB (added by nacin, 14 years ago)
  • wp-includes/wp-db.php

     
    461461        var $func_call;
    462462
    463463        /**
     464         * Whether MySQL is used as the database engine.
     465         *
     466         * Set in WPDB::db_connect() to true, by default. This is used when checking
     467         * against the required MySQL version for WordPress. Normally, a replacement
     468         * database drop-in (db.php) will skip these checks, but setting this to true
     469         * will force the checks to occur.
     470         *
     471         * @since 3.3.0
     472         * @access public
     473         * @var bool
     474         */
     475        public $is_mysql = null;
     476
     477        /**
    464478         * Connects to the database server and selects a database
    465479         *
    466480         * PHP5 style constructor for compatibility with PHP5. Does
     
    10131027         * @since 3.0.0
    10141028         */
    10151029        function db_connect() {
     1030
     1031                $this->is_mysql = true;
     1032
    10161033                if ( WP_DEBUG ) {
    10171034                        $this->dbh = mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, true );
    10181035                } else {
  • wp-admin/includes/update-core.php

     
    337337        $required_mysql_version = '5.0';
    338338        $wp_version = '3.2';
    339339        $php_compat     = version_compare( $php_version, $required_php_version, '>=' );
    340         $mysql_compat   = version_compare( $mysql_version, $required_mysql_version, '>=' ) || file_exists( WP_CONTENT_DIR . '/db.php' );
     340        if ( file_exists( WP_CONTENT_DIR . '/db.php' ) && empty( $this->is_mysql ) )
     341                $mysql_compat = true;
     342        else
     343                $mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' );
    341344
    342345        if ( !$mysql_compat || !$php_compat )
    343346                $wp_filesystem->delete($from, true);
  • wp-admin/upgrade.php

     
    3838$php_version    = phpversion();
    3939$mysql_version  = $wpdb->db_version();
    4040$php_compat     = version_compare( $php_version, $required_php_version, '>=' );
    41 $mysql_compat   = version_compare( $mysql_version, $required_mysql_version, '>=' ) || file_exists( WP_CONTENT_DIR . '/db.php' );
     41if ( file_exists( WP_CONTENT_DIR . '/db.php' ) && empty( $wpdb->is_mysql ) )
     42        $mysql_compat = true;
     43else
     44        $mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' );
    4245
    4346@header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
    4447?>
  • wp-admin/update-core.php

     
    4040                        $submit = __('Re-install Now');
    4141                        $form_action = 'update-core.php?action=do-core-reinstall';
    4242                } else {
    43                         $php_compat     = version_compare( $php_version, $update->php_version, '>=' );
    44                         $mysql_compat   = version_compare( $mysql_version, $update->mysql_version, '>=' ) || file_exists( WP_CONTENT_DIR . '/db.php' );
     43                        $php_compat     = version_compare( $php_version, $update->php_version, '>=' );                 
     44                        if ( file_exists( WP_CONTENT_DIR . '/db.php' ) && empty( $wpdb->is_mysql ) )
     45                                $mysql_compat = true;
     46                        else
     47                                $mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' );
     48
    4549                        if ( !$mysql_compat && !$php_compat )
    4650                                $message = sprintf( __('You cannot update because <a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires PHP version %2$s or higher and MySQL version %3$s or higher. You are running PHP version %4$s and MySQL version %5$s.'), $update->current, $update->php_version, $update->mysql_version, $php_version, $mysql_version );
    4751                        elseif ( !$php_compat )