WordPress.org

Make WordPress Core

Changeset 12576


Ignore:
Timestamp:
12/29/09 21:57:42 (8 years ago)
Author:
ryan
Message:

Check PHP and MySQL versions in upgrade.php. see #11666 for 2.9

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.9/wp-admin/upgrade.php

    r11930 r12576  
    3636$step = (int) $step; 
    3737 
     38$php_version    = phpversion(); 
     39$mysql_version  = $wpdb->db_version(); 
     40$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' ); 
     42 
    3843@header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) ); 
    3944?> 
     
    5459<p class="step"><a class="button" href="<?php echo get_option( 'home' ); ?>/"><?php _e( 'Continue' ); ?></a></p> 
    5560 
     61<?php elseif ( !$php_compat || !$mysql_compat ) : 
     62    if ( !$mysql_compat && !$php_compat ) 
     63        printf( __('You cannot upgrade 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 ); 
     64    elseif ( !$php_compat ) 
     65        printf( __('You cannot upgrade because WordPress %1$s requires PHP version %2$s or higher. You are running version %3$s.'), $wp_version, $required_php_version, $php_version ); 
     66    elseif ( !$mysql_compat ) 
     67        printf( __('You cannot upgrade because because WordPress %1$s requires MySQL version %2$s or higher. You are running version %3$s.'), $wp_version, $required_mysql_version, $mysql_version ); 
     68?> 
    5669<?php else : 
    5770switch ( $step ) : 
Note: See TracChangeset for help on using the changeset viewer.