Make sure the server has MySQL 4.0.0 before attempting upgrade or install. fixes #3615
git-svn-id: https://develop.svn.wordpress.org/trunk@4771 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
821b816f01
commit
f9f244b2d1
@ -11,6 +11,7 @@ if ( !function_exists('wp_install') ) :
|
||||
function wp_install($blog_title, $user_name, $user_email, $public, $meta='') {
|
||||
global $wp_rewrite;
|
||||
|
||||
wp_check_mysql_version();
|
||||
wp_cache_flush();
|
||||
make_db_current_silent();
|
||||
populate_options();
|
||||
@ -134,6 +135,7 @@ function wp_upgrade() {
|
||||
if ( $wp_db_version == $wp_current_db_version )
|
||||
return;
|
||||
|
||||
wp_check_mysql_version();
|
||||
wp_cache_flush();
|
||||
make_db_current_silent();
|
||||
upgrade_all();
|
||||
@ -1081,4 +1083,13 @@ function translate_level_to_role($level) {
|
||||
}
|
||||
}
|
||||
|
||||
function wp_check_mysql_version() {
|
||||
global $wp_version;
|
||||
|
||||
// Make sure the server has MySQL 4.0
|
||||
$mysql_version = preg_replace('|[^0-9\.]|', '', @mysql_get_server_info());
|
||||
if ( version_compare($mysql_version, '4.0.0', '<') )
|
||||
die(sprintf(__('<strong>ERROR</strong>: WordPress %s requires MySQL 4.0.0 or higher'), $wp_version));
|
||||
}
|
||||
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user