From 0494df8152abadd9eddde3f4719313e5f5d34c5d Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 29 Aug 2013 20:45:17 +0000 Subject: [PATCH] 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 --- .gitignore | 2 ++ Gruntfile.js | 18 ++++++++++---- src/wp-admin/setup-config.php | 24 +++++++++++++------ ...-config-sample.php => wp-config-sample.php | 0 4 files changed, 32 insertions(+), 12 deletions(-) rename src/wp-config-sample.php => wp-config-sample.php (100%) diff --git a/.gitignore b/.gitignore index 5bbd13fd3e..2edb60a5a6 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,8 @@ logs results wp-config.php +wp-tests-config.php +phpunit.xml node_modules npm-debug.log diff --git a/Gruntfile.js b/Gruntfile.js index 9c5e64c00b..deecaa6908 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -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, diff --git a/src/wp-admin/setup-config.php b/src/wp-admin/setup-config.php index 82d06e99dc..ce3ffe55b7 100644 --- a/src/wp-admin/setup-config.php +++ b/src/wp-admin/setup-config.php @@ -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( '

' . 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 installing now." ), 'install.php' ) . '

' ); @@ -275,12 +278,19 @@ el.select();

diff --git a/src/wp-config-sample.php b/wp-config-sample.php similarity index 100% rename from src/wp-config-sample.php rename to wp-config-sample.php