Declare `$wp_version`, `$required_php_version`, and `$required_mysql_version` as globals in install and upgrade admin files.

See #30799.

Built from https://develop.svn.wordpress.org/trunk@31124


git-svn-id: http://core.svn.wordpress.org/trunk@31105 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-01-10 05:57:22 +00:00
parent 1bac6fb886
commit 1b3f91f500
5 changed files with 10 additions and 2 deletions

View File

@ -812,6 +812,8 @@ function update_core($from, $to) {
// Import $wp_version, $required_php_version, and $required_mysql_version from the new version
// $wp_filesystem->wp_content_dir() returned unslashed pre-2.8
global $wp_version, $required_php_version, $required_mysql_version;
$versions_file = trailingslashit( $wp_filesystem->wp_content_dir() ) . 'upgrade/version-current.php';
if ( ! $wp_filesystem->copy( $from . $distro . 'wp-includes/version.php', $versions_file ) ) {
$wp_filesystem->delete( $from, true );
@ -824,7 +826,7 @@ function update_core($from, $to) {
$php_version = phpversion();
$mysql_version = $wpdb->db_version();
$old_wp_version = $GLOBALS['wp_version']; // The version of WordPress we're updating from
$old_wp_version = $wp_version; // The version of WordPress we're updating from
$development_build = ( false !== strpos( $old_wp_version . $wp_version, '-' ) ); // a dash in the version indicates a Development release
$php_compat = version_compare( $php_version, $required_php_version, '>=' );
if ( file_exists( WP_CONTENT_DIR . '/db.php' ) && empty( $wpdb->is_mysql ) )

View File

@ -159,6 +159,8 @@ if ( is_blog_installed() ) {
die( '<h1>' . __( 'Already Installed' ) . '</h1><p>' . __( 'You appear to have already installed WordPress. To reinstall please clear your old database tables first.' ) . '</p><p class="step"><a href="../wp-login.php" class="button button-large">' . __( 'Log In' ) . '</a></p></body></html>' );
}
global $wp_version, $required_php_version, $required_mysql_version;
$php_version = phpversion();
$mysql_version = $wpdb->db_version();
$php_compat = version_compare( $php_version, $required_php_version, '>=' );

View File

@ -319,6 +319,8 @@ if ( empty($tzstring) ) { // Create a UTC+- zone if no timezone string exists
<th scope="row"><label for="start_of_week"><?php _e('Week Starts On') ?></label></th>
<td><select name="start_of_week" id="start_of_week">
<?php
global $wp_locale;
for ($day_index = 0; $day_index <= 6; $day_index++) :
$selected = (get_option('start_of_week') == $day_index) ? 'selected="selected"' : '';
echo "\n\t<option value='" . esc_attr($day_index) . "' $selected>" . $wp_locale->get_weekday($day_index) . '</option>';

View File

@ -35,6 +35,8 @@ if ( 'upgrade_db' === $step ) {
die( '0' );
}
global $wp_version, $required_php_version, $required_mysql_version;
$step = (int) $step;
$php_version = phpversion();

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.2-alpha-31123';
$wp_version = '4.2-alpha-31124';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.