|
24 | 24 | /** |
25 | 25 | * Disable error reporting |
26 | 26 | * |
27 | | - * Set this to error_reporting( E_ALL ) or error_reporting( E_ALL | E_STRICT ) for debugging |
| 27 | + * Set this to error_reporting( -1 ) for debugging |
28 | 28 | */ |
29 | | -error_reporting(0); |
| 29 | +error_reporting(-1); |
30 | 30 |
|
31 | | -/**#@+ |
32 | | - * These three defines are required to allow us to use require_wp_db() to load |
33 | | - * the database class while being wp-content/db.php aware. |
34 | | - * @ignore |
35 | | - */ |
36 | | -define('ABSPATH', dirname(dirname(__FILE__)).'/'); |
37 | | -define('WPINC', 'wp-includes'); |
38 | | -define('WP_CONTENT_DIR', ABSPATH . 'wp-content'); |
39 | | -define('WP_DEBUG', false); |
40 | | -/**#@-*/ |
41 | | - |
42 | | -require(ABSPATH . WPINC . '/load.php'); |
43 | | -require(ABSPATH . WPINC . '/version.php'); |
44 | | - |
45 | | -// Check for the required PHP version and for the MySQL extension or a database drop-in. |
46 | | -wp_check_php_mysql_versions(); |
47 | | - |
48 | | -require_once(ABSPATH . WPINC . '/functions.php'); |
49 | | - |
50 | | -// Also loads plugin.php, l10n.php, pomo/mo.php (all required by setup-config.php) |
51 | | -wp_load_translations_early(); |
| 31 | +define( 'ABSPATH', dirname( dirname( __FILE__ ) ) . '/' ); |
52 | 32 |
|
53 | | -// Turn register_globals off. |
54 | | -wp_unregister_GLOBALS(); |
55 | | - |
56 | | -// Standardize $_SERVER variables across setups. |
57 | | -wp_fix_server_vars(); |
58 | | - |
59 | | -require_once(ABSPATH . WPINC . '/compat.php'); |
60 | | -require_once(ABSPATH . WPINC . '/class-wp-error.php'); |
61 | | -require_once(ABSPATH . WPINC . '/formatting.php'); |
62 | | - |
63 | | -// Add magic quotes and set up $_REQUEST ( $_GET + $_POST ) |
64 | | -wp_magic_quotes(); |
| 33 | +require_once( ABSPATH . 'wp-includes/plugin.php' ); |
| 34 | +add_action( 'plugins_loaded', 'wp_load_translations_early' ); |
| 35 | +require( ABSPATH . 'wp-settings.php' ); |
65 | 36 |
|
66 | 37 | // Support wp-config-sample.php one level up, for the develop repo. |
67 | 38 | if ( file_exists( ABSPATH . 'wp-config-sample.php' ) ) |
@@ -120,7 +91,11 @@ function setup_config_display_header() { |
120 | 91 | <li><?php _e( 'Database host' ); ?></li> |
121 | 92 | <li><?php _e( 'Table prefix (if you want to run more than one WordPress in a single database)' ); ?></li> |
122 | 93 | </ol> |
123 | | -<p><strong><?php _e( "If for any reason this automatic file creation doesn’t work, don’t worry. All this does is fill in the database information to a configuration file. You may also simply open <code>wp-config-sample.php</code> in a text editor, fill in your information, and save it as <code>wp-config.php</code>." ); ?></strong></p> |
| 94 | +<p> |
| 95 | + <?php _e( 'We’re going to use this information to create a <code>wp-config.php</code> file.' ); ?> |
| 96 | + <strong><?php _e( "If for any reason this automatic file creation doesn’t work, don’t worry. All this does is fill in the database information to a configuration file. You may also simply open <code>wp-config-sample.php</code> in a text editor, fill in your information, and save it as <code>wp-config.php</code>." ); ?></strong> |
| 97 | + <?php _e( "Need more help? <a href='http://codex.wordpress.org/Editing_wp-config.php'>We got it</a>." ); ?> |
| 98 | +</p> |
124 | 99 | <p><?php _e( "In all likelihood, these items were supplied to you by your Web Host. If you do not have this information, then you will need to contact them before you can continue. If you’re all ready…" ); ?></p> |
125 | 100 |
|
126 | 101 | <p class="step"><a href="setup-config.php?step=1<?php if ( isset( $_GET['noapi'] ) ) echo '&noapi'; ?>" class="button button-large"><?php _e( 'Let’s go!' ); ?></a></p> |
@@ -191,29 +166,25 @@ function setup_config_display_header() { |
191 | 166 | define('DB_HOST', $dbhost); |
192 | 167 | /**#@-*/ |
193 | 168 |
|
194 | | - // We'll fail here if the values are no good. |
| 169 | + // Re-construct $wpdb with these new values. |
| 170 | + unset( $wpdb ); |
195 | 171 | require_wp_db(); |
| 172 | + |
| 173 | + // The wpdb constructor bails when WP_SETUP_CONFIG is set, so we must |
| 174 | + // fire this manually. We'll fail here if the values are no good. |
| 175 | + $wpdb->db_connect(); |
| 176 | + |
196 | 177 | if ( ! empty( $wpdb->error ) ) |
197 | 178 | wp_die( $wpdb->error->get_error_message() . $tryagain_link ); |
198 | 179 |
|
199 | 180 | // Fetch or generate keys and salts. |
200 | 181 | $no_api = isset( $_POST['noapi'] ); |
201 | 182 | if ( ! $no_api ) { |
202 | | - require_once( ABSPATH . WPINC . '/class-http.php' ); |
203 | | - require_once( ABSPATH . WPINC . '/http.php' ); |
204 | | - /**#@+ |
205 | | - * @ignore |
206 | | - */ |
207 | | - function get_bloginfo() { |
208 | | - return wp_guess_url(); |
209 | | - } |
210 | | - /**#@-*/ |
211 | 183 | $secret_keys = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/salt/' ); |
212 | 184 | } |
213 | 185 |
|
214 | 186 | if ( $no_api || is_wp_error( $secret_keys ) ) { |
215 | 187 | $secret_keys = array(); |
216 | | - require_once( ABSPATH . WPINC . '/pluggable.php' ); |
217 | 188 | for ( $i = 0; $i < 8; $i++ ) { |
218 | 189 | $secret_keys[] = wp_generate_password( 64, true, true ); |
219 | 190 | } |
|
0 commit comments