Skip to content

Commit 0494df8

Browse files
committed
Move wp-config-sample.php to the root of develop.svn.
wp-config.php is now created in the root. wp-config-sample.php is properly copied over to the build directory for syncing to core.svn. Add some ignores. fixes #25185, see #24976. git-svn-id: https://develop.svn.wordpress.org/trunk@25173 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 27e2fd8 commit 0494df8

File tree

4 files changed

+32
-12
lines changed

4 files changed

+32
-12
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ logs
1212
results
1313

1414
wp-config.php
15+
wp-tests-config.php
16+
phpunit.xml
1517

1618
node_modules
1719
npm-debug.log

Gruntfile.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,19 @@ module.exports = function(grunt) {
1717
},
1818
copy: {
1919
all: {
20-
dot: true,
21-
expand: true,
22-
cwd: SOURCE_DIR,
23-
src: ['**','!**/.{svn,git}/**'], // Ignore version control directories.
24-
dest: BUILD_DIR
20+
files: [
21+
{
22+
dot: true,
23+
expand: true,
24+
cwd: SOURCE_DIR,
25+
src: ['**','!**/.{svn,git}/**'], // Ignore version control directories.
26+
dest: BUILD_DIR
27+
},
28+
{
29+
src: 'wp-config-sample.php',
30+
dest: BUILD_DIR
31+
}
32+
]
2533
},
2634
dynamic: {
2735
dot: true,

src/wp-admin/setup-config.php

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,14 @@
6262
// Add magic quotes and set up $_REQUEST ( $_GET + $_POST )
6363
wp_magic_quotes();
6464

65-
if ( ! file_exists( ABSPATH . 'wp-config-sample.php' ) )
65+
// Support wp-config-sample.php one level up, for the develop repo.
66+
if ( file_exists( ABSPATH . 'wp-config-sample.php' ) )
67+
$config_file = file( ABSPATH . 'wp-config-sample.php' );
68+
elseif ( file_exists( dirname( ABSPATH ) . '/wp-config-sample.php' ) )
69+
$config_file = file( dirname( ABSPATH ) . '/wp-config-sample.php' );
70+
else
6671
wp_die( __( 'Sorry, I need a wp-config-sample.php file to work from. Please re-upload this file from your WordPress installation.' ) );
6772

68-
$config_file = file(ABSPATH . 'wp-config-sample.php');
69-
7073
// Check if wp-config.php has been created
7174
if ( file_exists( ABSPATH . 'wp-config.php' ) )
7275
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>' );
@@ -275,12 +278,19 @@ function get_bloginfo() {
275278
</script>
276279
<?php
277280
else :
278-
$handle = fopen(ABSPATH . 'wp-config.php', 'w');
281+
// If this file doesn't exist, then we are using the wp-config-sample.php
282+
// file one level up, which is for the develop repo.
283+
if ( file_exists( ABSPATH . 'wp-config-sample.php' ) )
284+
$path_to_wp_config = ABSPATH . 'wp-config.php';
285+
else
286+
$path_to_wp_config = dirname( ABSPATH ) . '/wp-config.php';
287+
288+
$handle = fopen( $path_to_wp_config, 'w' );
279289
foreach( $config_file as $line ) {
280-
fwrite($handle, $line);
290+
fwrite( $handle, $line );
281291
}
282-
fclose($handle);
283-
chmod(ABSPATH . 'wp-config.php', 0666);
292+
fclose( $handle );
293+
chmod( $path_to_wp_config, 0666 );
284294
setup_config_display_header();
285295
?>
286296
<p><?php _e( "All right, sparky! You&#8217;ve made it through this part of the installation. WordPress can now communicate with your database. If you are ready, time now to&hellip;" ); ?></p>

0 commit comments

Comments
 (0)