X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/41578db67d72562346e4dbb2a14889b23d522813..88550bc3400cc7c035ff590ecb007c7938041ded:/wp-admin/setup-config.php diff --git a/wp-admin/setup-config.php b/wp-admin/setup-config.php index 2b5b7f89..5f71f53e 100644 --- a/wp-admin/setup-config.php +++ b/wp-admin/setup-config.php @@ -24,44 +24,21 @@ define('WP_SETUP_CONFIG', true); /** * Disable error reporting * - * Set this to error_reporting( E_ALL ) or error_reporting( E_ALL | E_STRICT ) for debugging + * Set this to error_reporting( -1 ) for debugging */ error_reporting(0); -/**#@+ - * These three defines are required to allow us to use require_wp_db() to load - * the database class while being wp-content/db.php aware. - * @ignore - */ -define('ABSPATH', dirname(dirname(__FILE__)).'/'); -define('WPINC', 'wp-includes'); -define('WP_CONTENT_DIR', ABSPATH . 'wp-content'); -define('WP_DEBUG', false); -/**#@-*/ - -require(ABSPATH . WPINC . '/load.php'); -require(ABSPATH . WPINC . '/version.php'); - -// Check for the required PHP version and for the MySQL extension or a database drop-in. -wp_check_php_mysql_versions(); +define( 'ABSPATH', dirname( dirname( __FILE__ ) ) . '/' ); -require_once(ABSPATH . WPINC . '/functions.php'); +require( ABSPATH . 'wp-settings.php' ); -// Also loads plugin.php, l10n.php, pomo/mo.php (all required by setup-config.php) -wp_load_translations_early(); +/** Load WordPress Administration Upgrade API */ +require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); -// Turn register_globals off. -wp_unregister_GLOBALS(); +/** Load WordPress Translation Install API */ +require_once( ABSPATH . 'wp-admin/includes/translation-install.php' ); -// Standardize $_SERVER variables across setups. -wp_fix_server_vars(); - -require_once(ABSPATH . WPINC . '/compat.php'); -require_once(ABSPATH . WPINC . '/class-wp-error.php'); -require_once(ABSPATH . WPINC . '/formatting.php'); - -// Add magic quotes and set up $_REQUEST ( $_GET + $_POST ) -wp_magic_quotes(); +nocache_headers(); // Support wp-config-sample.php one level up, for the develop repo. if ( file_exists( ABSPATH . 'wp-config-sample.php' ) ) @@ -79,7 +56,7 @@ if ( file_exists( ABSPATH . 'wp-config.php' ) ) if ( file_exists(ABSPATH . '../wp-config.php' ) && ! file_exists( ABSPATH . '../wp-settings.php' ) ) wp_die( '

' . sprintf( __( "The file 'wp-config.php' already exists one level above your WordPress installation. If you need to reset any of the configuration items in this file, please delete it first. You may try installing now."), 'install.php' ) . '

' ); -$step = isset( $_GET['step'] ) ? (int) $_GET['step'] : 0; +$step = isset( $_GET['step'] ) ? (int) $_GET['step'] : -1; /** * Display setup wp-config.php file header. @@ -87,29 +64,65 @@ $step = isset( $_GET['step'] ) ? (int) $_GET['step'] : 0; * @ignore * @since 2.3.0 */ -function setup_config_display_header() { +function setup_config_display_header( $body_classes = array() ) { global $wp_version; + $body_classes = (array) $body_classes; + $body_classes[] = 'wp-core-ui'; + if ( is_rtl() ) { + $body_classes[] = 'rtl'; + } header( 'Content-Type: text/html; charset=utf-8' ); ?> > - - -<?php _e( 'WordPress › Setup Configuration File' ); ?> - - - + + + <?php _e( 'WordPress › Setup Configuration File' ); ?> + - -

+ +

'; + wp_install_language_form( $languages ); + echo ''; + break; + } + + // Deliberately fall through if we can't reach the translations API. + case 0: + if ( ! empty( $language ) ) { + $loaded_language = wp_download_language_pack( $language ); + if ( $loaded_language ) { + load_default_textdomain( $loaded_language ); + $GLOBALS['wp_locale'] = new WP_Locale(); + } + } + setup_config_display_header(); + $step_1 = 'setup-config.php?step=1'; + if ( isset( $_REQUEST['noapi'] ) ) { + $step_1 .= '&noapi'; + } + if ( ! empty( $loaded_language ) ) { + $step_1 .= '&language=' . $loaded_language; + } ?>

@@ -120,14 +133,21 @@ switch($step) {
  • -

    wp-config-sample.php in a text editor, fill in your information, and save it as wp-config.php." ); ?>

    +

    + wp-config.php file.' ); ?> + wp-config-sample.php in a text editor, fill in your information, and save it as wp-config.php." ); ?> + We got it." ); ?> +

    -

    +

    @@ -145,7 +165,7 @@ switch($step) { - + @@ -160,16 +180,36 @@ switch($step) { +

    ' . __( 'Try again' ) . ''; + $tryagain_link = '

    ' . __( 'Try again' ) . ''; if ( empty( $prefix ) ) wp_die( __( 'ERROR: "Table Prefix" must not be empty.' . $tryagain_link ) ); @@ -188,29 +228,27 @@ switch($step) { define('DB_HOST', $dbhost); /**#@-*/ - // We'll fail here if the values are no good. + // Re-construct $wpdb with these new values. + unset( $wpdb ); require_wp_db(); + + /* + * The wpdb constructor bails when WP_SETUP_CONFIG is set, so we must + * fire this manually. We'll fail here if the values are no good. + */ + $wpdb->db_connect(); + if ( ! empty( $wpdb->error ) ) wp_die( $wpdb->error->get_error_message() . $tryagain_link ); // Fetch or generate keys and salts. $no_api = isset( $_POST['noapi'] ); if ( ! $no_api ) { - require_once( ABSPATH . WPINC . '/class-http.php' ); - require_once( ABSPATH . WPINC . '/http.php' ); - /**#@+ - * @ignore - */ - function get_bloginfo() { - return wp_guess_url(); - } - /**#@-*/ $secret_keys = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/salt/' ); } if ( $no_api || is_wp_error( $secret_keys ) ) { $secret_keys = array(); - require_once( ABSPATH . WPINC . '/pluggable.php' ); for ( $i = 0; $i < 8; $i++ ) { $secret_keys[] = wp_generate_password( 64, true, true ); } @@ -267,18 +305,22 @@ switch($step) { } ?>

    -

    +

    -

    +

    +