34 wp_upgrade(); |
34 wp_upgrade(); |
35 die( '0' ); |
35 die( '0' ); |
36 } |
36 } |
37 |
37 |
38 /** |
38 /** |
39 * @global string $wp_version The WordPress version string. |
39 * @global string $wp_version The WordPress version string. |
40 * @global string $required_php_version The required PHP version string. |
40 * @global string $required_php_version The required PHP version string. |
41 * @global string $required_mysql_version The required MySQL version string. |
41 * @global string[] $required_php_extensions The names of required PHP extensions. |
42 * @global wpdb $wpdb WordPress database abstraction object. |
42 * @global string $required_mysql_version The required MySQL version string. |
|
43 * @global wpdb $wpdb WordPress database abstraction object. |
43 */ |
44 */ |
44 global $wp_version, $required_php_version, $required_mysql_version, $wpdb; |
45 global $wp_version, $required_php_version, $required_php_extensions, $required_mysql_version, $wpdb; |
45 |
46 |
46 $step = (int) $step; |
47 $step = (int) $step; |
47 |
48 |
48 $php_version = PHP_VERSION; |
49 $php_version = PHP_VERSION; |
49 $mysql_version = $wpdb->db_version(); |
50 $mysql_version = $wpdb->db_version(); |
52 $mysql_compat = true; |
53 $mysql_compat = true; |
53 } else { |
54 } else { |
54 $mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' ); |
55 $mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' ); |
55 } |
56 } |
56 |
57 |
|
58 $missing_extensions = array(); |
|
59 |
|
60 if ( isset( $required_php_extensions ) && is_array( $required_php_extensions ) ) { |
|
61 foreach ( $required_php_extensions as $extension ) { |
|
62 if ( extension_loaded( $extension ) ) { |
|
63 continue; |
|
64 } |
|
65 |
|
66 $missing_extensions[] = sprintf( |
|
67 /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: The PHP extension name needed. */ |
|
68 __( 'You cannot upgrade because <a href="%1$s">WordPress %2$s</a> requires the %3$s PHP extension.' ), |
|
69 $version_url, |
|
70 $wp_version, |
|
71 $extension |
|
72 ); |
|
73 } |
|
74 } |
|
75 |
57 header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) ); |
76 header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) ); |
58 ?> |
77 ?> |
59 <!DOCTYPE html> |
78 <!DOCTYPE html> |
60 <html <?php language_attributes(); ?>> |
79 <html <?php language_attributes(); ?>> |
61 <head> |
80 <head> |
62 <meta name="viewport" content="width=device-width" /> |
81 <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
63 <meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>; charset=<?php echo get_option( 'blog_charset' ); ?>" /> |
82 <meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>; charset=<?php echo get_option( 'blog_charset' ); ?>" /> |
64 <meta name="robots" content="noindex,nofollow" /> |
83 <meta name="robots" content="noindex,nofollow" /> |
65 <title><?php _e( 'WordPress › Update' ); ?></title> |
84 <title><?php _e( 'WordPress › Update' ); ?></title> |
66 <?php wp_admin_css( 'install', true ); ?> |
85 <?php wp_admin_css( 'install', true ); ?> |
67 </head> |
86 </head> |