X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/af50974463450c98503e763a7836a50e260461a9..9441756a895fb4fdc4bcf20e0d228cef622663ca:/wp-admin/setup-config.php diff --git a/wp-admin/setup-config.php b/wp-admin/setup-config.php index 5f71f53e..5364fa78 100644 --- a/wp-admin/setup-config.php +++ b/wp-admin/setup-config.php @@ -46,15 +46,26 @@ if ( file_exists( ABSPATH . 'wp-config-sample.php' ) ) elseif ( file_exists( dirname( ABSPATH ) . '/wp-config-sample.php' ) ) $config_file = file( dirname( ABSPATH ) . '/wp-config-sample.php' ); else - wp_die( __( 'Sorry, I need a wp-config-sample.php file to work from. Please re-upload this file from your WordPress installation.' ) ); + wp_die( __( 'Sorry, I need a wp-config-sample.php file to work from. Please re-upload this file to your WordPress installation.' ) ); // Check if wp-config.php has been created if ( file_exists( ABSPATH . 'wp-config.php' ) ) - wp_die( '

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

' ); + wp_die( '

' . sprintf( + /* translators: %s: install.php */ + __( "The file 'wp-config.php' already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try installing now." ), + 'install.php' + ) . '

' + ); // Check if wp-config.php exists above the root directory but is not part of another install -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' ) . '

' ); +if ( @file_exists( ABSPATH . '../wp-config.php' ) && ! @file_exists( ABSPATH . '../wp-settings.php' ) ) { + wp_die( '

' . sprintf( + /* translators: %s: install.php */ + __( "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'] : -1; @@ -63,9 +74,13 @@ $step = isset( $_GET['step'] ) ? (int) $_GET['step'] : -1; * * @ignore * @since 2.3.0 + * + * @global string $wp_local_package + * @global WP_Locale $wp_locale + * + * @param string|array $body_classes */ function setup_config_display_header( $body_classes = array() ) { - global $wp_version; $body_classes = (array) $body_classes; $body_classes[] = 'wp-core-ui'; if ( is_rtl() ) { @@ -79,11 +94,12 @@ function setup_config_display_header( $body_classes = array() ) { + <?php _e( 'WordPress › Setup Configuration File' ); ?> -

+ Select a default language'; echo '
'; wp_install_language_form( $languages ); echo '
'; @@ -124,7 +141,7 @@ switch($step) { $step_1 .= '&language=' . $loaded_language; } ?> - +

  1. @@ -133,12 +150,26 @@ switch($step) {
-

- 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." ); ?> -

-

+

wp-config.php' + ); + ?> + wp-config-sample.php', + 'wp-config.php' + ); + ?> + We got it.' ), + __( 'https://codex.wordpress.org/Editing_wp-config.php' ) + ); +?>

+

+

-

+

@@ -171,7 +203,10 @@ switch($step) { - + @@ -280,6 +315,11 @@ switch($step) { case 'DB_HOST' : $config_file[ $line_num ] = "define('" . $constant . "'," . $padding . "'" . addcslashes( constant( $constant ), "\\'" ) . "');\r\n"; break; + case 'DB_CHARSET' : + if ( 'utf8mb4' === $wpdb->charset || ( ! $wpdb->charset && $wpdb->has_cap( 'utf8mb4' ) ) ) { + $config_file[ $line_num ] = "define('" . $constant . "'," . $padding . "'utf8mb4');\r\n"; + } + break; case 'AUTH_KEY' : case 'SECURE_AUTH_KEY' : case 'LOGGED_IN_KEY' : @@ -297,10 +337,16 @@ switch($step) { if ( ! is_writable(ABSPATH) ) : setup_config_display_header(); ?> -

wp-config.php file." ); ?>

-

wp-config.php manually and paste the following text into it.' ); ?>

+

wp-config.php' ); +?>

+

wp-config.php' ); +?>

@@ -327,14 +373,15 @@ if ( ! /iPad|iPod|iPhone/.test( navigator.userAgent ) ) { $path_to_wp_config = dirname( ABSPATH ) . '/wp-config.php'; $handle = fopen( $path_to_wp_config, 'w' ); - foreach( $config_file as $line ) { + foreach ( $config_file as $line ) { fwrite( $handle, $line ); } fclose( $handle ); chmod( $path_to_wp_config, 0666 ); setup_config_display_header(); ?> -

+

+

localhost does not work.' ); ?>localhost' ); + ?>