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:
parent
27e2fd864f
commit
0494df8152
2
.gitignore
vendored
2
.gitignore
vendored
@ -12,6 +12,8 @@ logs
|
|||||||
results
|
results
|
||||||
|
|
||||||
wp-config.php
|
wp-config.php
|
||||||
|
wp-tests-config.php
|
||||||
|
phpunit.xml
|
||||||
|
|
||||||
node_modules
|
node_modules
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
|
@ -17,12 +17,20 @@ module.exports = function(grunt) {
|
|||||||
},
|
},
|
||||||
copy: {
|
copy: {
|
||||||
all: {
|
all: {
|
||||||
|
files: [
|
||||||
|
{
|
||||||
dot: true,
|
dot: true,
|
||||||
expand: true,
|
expand: true,
|
||||||
cwd: SOURCE_DIR,
|
cwd: SOURCE_DIR,
|
||||||
src: ['**','!**/.{svn,git}/**'], // Ignore version control directories.
|
src: ['**','!**/.{svn,git}/**'], // Ignore version control directories.
|
||||||
dest: BUILD_DIR
|
dest: BUILD_DIR
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
src: 'wp-config-sample.php',
|
||||||
|
dest: BUILD_DIR
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
dynamic: {
|
dynamic: {
|
||||||
dot: true,
|
dot: true,
|
||||||
expand: true,
|
expand: true,
|
||||||
|
@ -62,11 +62,14 @@ require_once(ABSPATH . WPINC . '/formatting.php');
|
|||||||
// Add magic quotes and set up $_REQUEST ( $_GET + $_POST )
|
// Add magic quotes and set up $_REQUEST ( $_GET + $_POST )
|
||||||
wp_magic_quotes();
|
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.' ) );
|
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
|
// Check if wp-config.php has been created
|
||||||
if ( file_exists( ABSPATH . 'wp-config.php' ) )
|
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>' );
|
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>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
else :
|
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 ) {
|
foreach( $config_file as $line ) {
|
||||||
fwrite($handle, $line);
|
fwrite( $handle, $line );
|
||||||
}
|
}
|
||||||
fclose($handle);
|
fclose( $handle );
|
||||||
chmod(ABSPATH . 'wp-config.php', 0666);
|
chmod( $path_to_wp_config, 0666 );
|
||||||
setup_config_display_header();
|
setup_config_display_header();
|
||||||
?>
|
?>
|
||||||
<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>
|
<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>
|
||||||
|
Loading…
Reference in New Issue
Block a user