Make WordPress Core

Changeset 4771


Ignore:
Timestamp:
01/19/2007 09:28:02 AM (18 years ago)
Author:
markjaquith
Message:

Make sure the server has MySQL 4.0.0 before attempting upgrade or install. fixes #3615

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/upgrade-functions.php

    r4738 r4771  
    1212    global $wp_rewrite;
    1313
     14    wp_check_mysql_version();
    1415    wp_cache_flush();
    1516    make_db_current_silent();
     
    135136        return;
    136137
     138    wp_check_mysql_version();
    137139    wp_cache_flush();
    138140    make_db_current_silent();
     
    10821084}
    10831085
     1086function wp_check_mysql_version() {
     1087    global $wp_version;
     1088
     1089    // Make sure the server has MySQL 4.0
     1090    $mysql_version = preg_replace('|[^0-9\.]|', '', @mysql_get_server_info());
     1091    if ( version_compare($mysql_version, '4.0.0', '<') )
     1092        die(sprintf(__('<strong>ERROR</strong>: WordPress %s requires MySQL 4.0.0 or higher'), $wp_version));
     1093}
     1094
    10841095?>
Note: See TracChangeset for help on using the changeset viewer.