+ if ( ! is_writable(ABSPATH) ) :
+ setup_config_display_header();
+?>
+<p><?php _e( "Sorry, but I can’t write the <code>wp-config.php</code> file." ); ?></p>
+<p><?php _e( 'You can create the <code>wp-config.php</code> manually and paste the following text into it.' ); ?></p>
+<textarea id="wp-config" cols="98" rows="15" class="code" readonly="readonly"><?php
+ foreach( $config_file as $line ) {
+ echo htmlentities($line, ENT_COMPAT, 'UTF-8');
+ }
+?></textarea>
+<p><?php _e( 'After you’ve done that, click “Run the install.”' ); ?></p>
+<p class="step"><a href="<?php echo $install; ?>" class="button button-large"><?php _e( 'Run the install' ); ?></a></p>
+<script>
+(function(){
+if ( ! /iPad|iPod|iPhone/.test( navigator.userAgent ) ) {
+ var el = document.getElementById('wp-config');
+ el.focus();
+ el.select();
+}
+})();
+</script>
+<?php
+ else :
+ /*
+ * If this file doesn't exist, then we are using the wp-config-sample.php
+ * file one level up, which is for the develop repo.
+ */
+ if ( file_exists( ABSPATH . 'wp-config-sample.php' ) )
+ $path_to_wp_config = ABSPATH . 'wp-config.php';
+ else
+ $path_to_wp_config = dirname( ABSPATH ) . '/wp-config.php';
+
+ $handle = fopen( $path_to_wp_config, 'w' );
+ foreach( $config_file as $line ) {
+ fwrite( $handle, $line );
+ }
+ fclose( $handle );
+ chmod( $path_to_wp_config, 0666 );
+ setup_config_display_header();