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
This commit is contained in:
Andrew Nacin 2013-08-29 20:45:17 +00:00
parent 27e2fd864f
commit 0494df8152
4 changed files with 32 additions and 12 deletions

2
.gitignore vendored
View File

@ -12,6 +12,8 @@ logs
results
wp-config.php
wp-tests-config.php
phpunit.xml
node_modules
npm-debug.log

View File

@ -17,11 +17,19 @@ module.exports = function(grunt) {
},
copy: {
all: {
dot: true,
expand: true,
cwd: SOURCE_DIR,
src: ['**','!**/.{svn,git}/**'], // Ignore version control directories.
dest: BUILD_DIR
files: [
{
dot: true,
expand: true,
cwd: SOURCE_DIR,
src: ['**','!**/.{svn,git}/**'], // Ignore version control directories.
dest: BUILD_DIR
},
{
src: 'wp-config-sample.php',
dest: BUILD_DIR
}
]
},
dynamic: {
dot: true,

View File

@ -62,11 +62,14 @@ require_once(ABSPATH . WPINC . '/formatting.php');
// Add magic quotes and set up $_REQUEST ( $_GET + $_POST )
wp_magic_quotes();
if ( ! file_exists( ABSPATH . 'wp-config-sample.php' ) )
// Support wp-config-sample.php one level up, for the develop repo.
if ( file_exists( ABSPATH . 'wp-config-sample.php' ) )
$config_file = file( 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.' ) );
$config_file = file(ABSPATH . 'wp-config-sample.php');
// Check if wp-config.php has been created
if ( file_exists( ABSPATH . 'wp-config.php' ) )
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 @@ el.select();
</script>
<?php
else :
$handle = fopen(ABSPATH . 'wp-config.php', 'w');
// 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);
fwrite( $handle, $line );
}
fclose($handle);
chmod(ABSPATH . 'wp-config.php', 0666);
fclose( $handle );
chmod( $path_to_wp_config, 0666 );
setup_config_display_header();
?>
<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>