Changeset 19760 for trunk/wp-admin/setup-config.php
- Timestamp:
- 01/26/2012 08:34:27 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/setup-config.php
r19701 r19760 42 42 /**#@-*/ 43 43 44 require_once(ABSPATH . WPINC . '/load.php'); 45 require_once(ABSPATH . WPINC . '/version.php'); 44 require(ABSPATH . WPINC . '/load.php'); 45 require(ABSPATH . WPINC . '/version.php'); 46 47 // Also loads functions.php, plugin.php, l10n.php, pomo/mo.php (all required by setup-config.php) 48 wp_load_translations_early(); 49 46 50 wp_check_php_mysql_versions(); 47 51 48 52 require_once(ABSPATH . WPINC . '/compat.php'); 49 require_once(ABSPATH . WPINC . '/functions.php');50 53 require_once(ABSPATH . WPINC . '/class-wp-error.php'); 51 54 52 if ( !file_exists(ABSPATH . 'wp-config-sample.php'))53 wp_die( 'Sorry, I need a wp-config-sample.php file to work from. Please re-upload this file from your WordPress installation.');55 if ( ! file_exists( ABSPATH . 'wp-config-sample.php' ) ) 56 wp_die( __( 'Sorry, I need a wp-config-sample.php file to work from. Please re-upload this file from your WordPress installation.' ) ); 54 57 55 58 $config_file = file(ABSPATH . 'wp-config-sample.php'); 56 59 57 60 // Check if wp-config.php has been created 58 if ( file_exists(ABSPATH . 'wp-config.php'))59 wp_die( "<p>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 <a href='install.php'>installing now</a>.</p>");61 if ( file_exists( ABSPATH . 'wp-config.php' ) ) 62 wp_die( '<p>' . 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 <a href='%s'>installing now</a>." ), 'install.php' ) . '</p>' ); 60 63 61 64 // Check if wp-config.php exists above the root directory but is not part of another install 62 if (file_exists(ABSPATH . '../wp-config.php') && ! file_exists(ABSPATH . '../wp-settings.php')) 63 wp_die("<p>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 <a href='install.php'>installing now</a>.</p>"); 64 65 if (isset($_GET['step'])) 66 $step = $_GET['step']; 67 else 68 $step = 0; 65 if ( file_exists(ABSPATH . '../wp-config.php' ) && ! file_exists( ABSPATH . '../wp-settings.php' ) ) 66 wp_die( '<p>' . 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 <a href='install.php'>installing now</a>."), 'install.php' ) . '</p>' ); 67 68 $step = isset( $_GET['step'] ) ? (int) $_GET['step'] : 0; 69 69 70 70 /** … … 83 83 <head> 84 84 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 85 <title> WordPress › Setup Configuration File</title>85 <title><?php _e( 'WordPress › Setup Configuration File' ); ?></title> 86 86 <link rel="stylesheet" href="css/install.css" type="text/css" /> 87 87 … … 97 97 ?> 98 98 99 <p> Welcome to WordPress. Before getting started, we need some information on the database. You will need to know the following items before proceeding.</p>99 <p><?php _e( 'Welcome to WordPress. Before getting started, we need some information on the database. You will need to know the following items before proceeding.' ) ?></p> 100 100 <ol> 101 <li> Database name</li>102 <li> Database username</li>103 <li> Database password</li>104 <li> Database host</li>105 <li> Table prefix (if you want to run more than one WordPress in a single database)</li>101 <li><?php _e( 'Database name' ); ?></li> 102 <li><?php _e( 'Database username' ); ?></li> 103 <li><?php _e( 'Database password' ); ?></li> 104 <li><?php _e( 'Database host' ); ?></li> 105 <li><?php _e( 'Table prefix (if you want to run more than one WordPress in a single database)' ); ?></li> 106 106 </ol> 107 <p><strong> 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>108 <p>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>109 110 <p class="step"><a href="setup-config.php?step=1<?php if ( isset( $_GET['noapi'] ) ) echo '&noapi'; ?>" class="button"> Let’s go!</a></p>107 <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> 108 <p>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> 109 110 <p class="step"><a href="setup-config.php?step=1<?php if ( isset( $_GET['noapi'] ) ) echo '&noapi'; ?>" class="button"><?php _e( 'Let’s go!' ); ?></a></p> 111 111 <?php 112 112 break; … … 116 116 ?> 117 117 <form method="post" action="setup-config.php?step=2"> 118 <p> Below you should enter your database connection details. If you're not sure about these, contact your host.</p>118 <p><?php _e( "Below you should enter your database connection details. If you're not sure about these, contact your host." ); ?></p> 119 119 <table class="form-table"> 120 120 <tr> 121 <th scope="row"><label for="dbname"> Database Name</label></th>121 <th scope="row"><label for="dbname"><?php _e( 'Database Name' ); ?></label></th> 122 122 <td><input name="dbname" id="dbname" type="text" size="25" value="wordpress" /></td> 123 <td> The name of the database you want to run WP in.</td>124 </tr> 125 <tr> 126 <th scope="row"><label for="uname"> User Name</label></th>127 <td><input name="uname" id="uname" type="text" size="25" value=" username" /></td>128 <td> Your MySQL username</td>129 </tr> 130 <tr> 131 <th scope="row"><label for="pwd"> Password</label></th>132 <td><input name="pwd" id="pwd" type="text" size="25" value=" password" /></td>133 <td> ...and your MySQL password.</td>134 </tr> 135 <tr> 136 <th scope="row"><label for="dbhost"> Database Host</label></th>123 <td><?php _e( 'The name of the database you want to run WP in.' ); ?></td> 124 </tr> 125 <tr> 126 <th scope="row"><label for="uname"><?php _e( 'User Name' ); ?></label></th> 127 <td><input name="uname" id="uname" type="text" size="25" value="<?php echo htmlspecialchars( _x( 'username', 'example username' ), ENT_QUOTES ); ?>" /></td> 128 <td><?php _e( 'Your MySQL username' ); ?></td> 129 </tr> 130 <tr> 131 <th scope="row"><label for="pwd"><?php _e( 'Password' ); ?></label></th> 132 <td><input name="pwd" id="pwd" type="text" size="25" value="<?php echo htmlspecialchars( _x( 'password', 'example password' ), ENT_QUOTES ); ?>" /></td> 133 <td><?php _e( '…and your MySQL password.' ); ?></td> 134 </tr> 135 <tr> 136 <th scope="row"><label for="dbhost"><?php _e( 'Database Host' ); ?></label></th> 137 137 <td><input name="dbhost" id="dbhost" type="text" size="25" value="localhost" /></td> 138 <td> You should be able to get this info from your web host, if <code>localhost</code> does not work.</td>139 </tr> 140 <tr> 141 <th scope="row"><label for="prefix"> Table Prefix</label></th>138 <td><?php _e( 'You should be able to get this info from your web host, if <code>localhost</code> does not work.' ); ?></td> 139 </tr> 140 <tr> 141 <th scope="row"><label for="prefix"><?php _e( 'Table Prefix' ); ?></label></th> 142 142 <td><input name="prefix" id="prefix" type="text" value="wp_" size="25" /></td> 143 <td> If you want to run multiple WordPress installations in a single database, change this.</td>143 <td><?php _e( 'If you want to run multiple WordPress installations in a single database, change this.' ); ?></td> 144 144 </tr> 145 145 </table> 146 <?php if ( isset( $_GET['noapi'] ) ) { ?><input name="noapi" type="hidden" value=" true" /><?php } ?>147 <p class="step"><input name="submit" type="submit" value=" Submit" class="button" /></p>146 <?php if ( isset( $_GET['noapi'] ) ) { ?><input name="noapi" type="hidden" value="1" /><?php } ?> 147 <p class="step"><input name="submit" type="submit" value="<?php echo htmlspecialchars( __( 'Submit' ), ENT_QUOTES ); ?>" class="button" /></p> 148 148 </form> 149 149 <?php … … 161 161 // Validate $prefix: it can only contain letters, numbers and underscores 162 162 if ( preg_match( '|[^a-z0-9_]|i', $prefix ) ) 163 wp_die( /*WP_I18N_BAD_PREFIX*/'<strong>ERROR</strong>: "Table Prefix" can only contain numbers, letters, and underscores.'/*/WP_I18N_BAD_PREFIX*/);163 wp_die( __( '<strong>ERROR</strong>: "Table Prefix" can only contain numbers, letters, and underscores.' ) ); 164 164 165 165 // Test the db connection. … … 176 176 require_wp_db(); 177 177 if ( ! empty( $wpdb->error ) ) { 178 $back = '<p class="step"><a href="setup-config.php?step=1" onclick="javascript:history.go(-1);return false;" class="button"> Try Again</a></p>';178 $back = '<p class="step"><a href="setup-config.php?step=1" onclick="javascript:history.go(-1);return false;" class="button">' . __( 'Try Again' ) . '</a></p>'; 179 179 wp_die( $wpdb->error->get_error_message() . $back ); 180 180 } … … 182 182 // Fetch or generate keys and salts. 183 183 $no_api = isset( $_POST['noapi'] ); 184 require_once( ABSPATH . WPINC . '/plugin.php' );185 require_once( ABSPATH . WPINC . '/l10n.php' );186 require_once( ABSPATH . WPINC . '/pomo/translations.php' );187 184 if ( ! $no_api ) { 188 185 require_once( ABSPATH . WPINC . '/class-http.php' ); … … 249 246 display_header(); 250 247 ?> 251 <p> Sorry, but I can't write the <code>wp-config.php</code> file.</p>252 <p> You can create the <code>wp-config.php</code> manually and paste the following text into it.</p>248 <p><?php _e( "Sorry, but I can't write the <code>wp-config.php</code> file." ); ?></p> 249 <p><?php _e( 'You can create the <code>wp-config.php</code> manually and paste the following text into it.' ); ?></p> 253 250 <textarea cols="98" rows="15" class="code"><?php 254 251 foreach( $config_file as $line ) { … … 256 253 } 257 254 ?></textarea> 258 <p> After you've done that, click "Run the install."</p>259 <p class="step"><a href="install.php" class="button"> Run the install</a></p>255 <p><?php _e( 'After you\'ve done that, click "Run the install."' ); ?></p> 256 <p class="step"><a href="install.php" class="button"><?php _e( 'Run the install' ); ?></a></p> 260 257 <?php 261 258 else : … … 268 265 display_header(); 269 266 ?> 270 <p> All right sparky! You've made it through this part of the installation. WordPress can now communicate with your database. If you are ready, time now to…</p>271 272 <p class="step"><a href="install.php" class="button"> Run the install</a></p>267 <p><?php _e( "All right sparky! You've made it through this part of the installation. WordPress can now communicate with your database. If you are ready, time now to…" ); ?></p> 268 269 <p class="step"><a href="install.php" class="button"><?php _e( 'Run the install' ); ?></a></p> 273 270 <?php 274 271 endif;
Note: See TracChangeset
for help on using the changeset viewer.