WordPress.org

Make WordPress Core

Changeset 12450


Ignore:
Timestamp:
12/18/09 16:53:44 (4 years ago)
Author:
ryan
Message:

Hard code required version in update-core.php. see #11464

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/update-core.php

    r12432 r12450  
    220220    @set_time_limit( 300 ); 
    221221 
     222    $php_version    = phpversion(); 
     223    $mysql_version  = $wpdb->db_version(); 
     224    $required_php_version = '4.3'; 
     225    $required_mysql_version = '4.1.2'; 
     226    $wp_version = '2.9'; 
     227    $php_compat     = version_compare( $php_version, $required_php_version, '>=' ); 
     228    $mysql_compat   = version_compare( $mysql_version, $required_mysql_version, '>=' ) || file_exists( WP_CONTENT_DIR . '/db.php' ); 
     229 
     230    if ( !$mysql_compat && !$php_compat ) 
     231        return new WP_Error( 'php_mysql_not_compatible', sprintf( __('The update cannot be installed because WordPress %1$s 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.'), $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version ) ); 
     232    elseif ( !$php_compat ) 
     233        return new WP_Error( 'php_not_compatible', sprintf( __('The update cannot be installed because WordPress %1$s requires PHP version %2$s or higher. You are running version %3$s.'), $wp_version, $required_php_version, $php_version ) ); 
     234    elseif ( !$mysql_compat ) 
     235        return new WP_Error( 'mysql_not_compatible', sprintf( __('The update cannot be installed because WordPress %1$s requires MySQL version %2$s or higher. You are running version %3$s.'), $wp_version, $required_mysql_version, $mysql_version ) ); 
     236 
    222237    // Sanity check the unzipped distribution 
    223238    apply_filters('update_feedback', __('Verifying the unpacked files')); 
     
    228243    } 
    229244 
    230     include( $from . '/wordpress/wp-includes/version.php' ); 
    231     $php_version    = phpversion(); 
    232     $mysql_version  = $wpdb->db_version(); 
    233     $php_compat     = version_compare( $php_version, $required_php_version, '>=' ); 
    234     $mysql_compat   = version_compare( $mysql_version, $required_mysql_version, '>=' ) || file_exists( WP_CONTENT_DIR . '/db.php' ); 
    235  
    236     if ( !$mysql_compat && !$php_compat ) 
    237         return new WP_Error( 'php_mysql_not_compatible', sprintf( __('The update cannot be installed because WordPress %1$s 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.'), $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version ) ); 
    238     elseif ( !$php_compat ) 
    239         return new WP_Error( 'php_not_compatible', sprintf( __('The update cannot be installed because WordPress %1$s requires PHP version %2$s or higher. You are running version %3$s.'), $wp_version, $required_php_version, $php_version ) ); 
    240     elseif ( !$mysql_compat ) 
    241         return new WP_Error( 'mysql_not_compatible', sprintf( __('The update cannot be installed because WordPress %1$s requires MySQL version %2$s or higher. You are running version %3$s.'), $wp_version, $required_mysql_version, $mysql_version ) ); 
    242  
    243245    apply_filters('update_feedback', __('Installing the latest version')); 
    244246 
Note: See TracChangeset for help on using the changeset viewer.