Fix includes for setup-config so that wp_die is defined. Props DD32. fixes #4997

git-svn-id: http://svn.automattic.com/wordpress/trunk@6137 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2007-09-19 04:27:56 +00:00
parent f25f33c4ba
commit 3ac0df5170
3 changed files with 23 additions and 9 deletions

View File

@ -1,6 +1,7 @@
<?php
define('WP_INSTALLING', true);
if (!file_exists('../wp-config.php')) {
require_once('../wp-includes/compat.php');
require_once('../wp-includes/functions.php');
wp_die("There doesn't seem to be a <code>wp-config.php</code> file. I need this before we can get started. Need more help? <a href='http://codex.wordpress.org/Editing_wp-config.php'>We got it</a>. You can <a href='setup-config.php'>create a <code>wp-config.php</code> file through a web interface</a>, but this doesn't work for all server setups. The safest way is to manually create the file.", "WordPress &rsaquo; Error");
}

View File

@ -1,19 +1,28 @@
<?php
define('WP_INSTALLING', true);
require_once('../wp-includes/compat.php');
require_once('../wp-includes/functions.php');
if (!file_exists('../wp-config-sample.php'))
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.');
$configFile = file('../wp-config-sample.php');
if (!is_writable('../')) die("Sorry, I can't write to the directory. You'll have to either change the permissions on your WordPress directory or create your wp-config.php manually.");
if ( !is_writable('../'))
wp_die("Sorry, I can't write to the directory. You'll have to either change the permissions on your WordPress directory or create your wp-config.php manually.");
// Check if wp-config.php has been created
if (file_exists('../wp-config.php'))
wp_die("<p>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='install.php'>installing now</a>.</p>");
if (isset($_GET['step']))
$step = $_GET['step'];
else
$step = 0;
header( 'Content-Type: text/html; charset=utf-8' );
function display_header(){
header( 'Content-Type: text/html; charset=utf-8' );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
@ -76,12 +85,11 @@ header( 'Content-Type: text/html; charset=utf-8' );
<body>
<h1 id="logo"><img alt="WordPress" src="images/wordpress-logo.png" /></h1>
<?php
// Check if wp-config.php has been created
if (file_exists('../wp-config.php'))
die("<p>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='install.php'>installing now</a>.</p></body></html>");
}//end function display_header();
switch($step) {
case 0:
display_header();
?>
<p>Welcome to WordPress. Before getting started, we need some information on the database. You will need to know the following items before proceeding.</p>
@ -98,6 +106,7 @@ switch($step) {
break;
case 1:
display_header();
?>
</p>
<form method="post" action="setup-config.php?step=2">
@ -177,6 +186,8 @@ switch($step) {
}
fclose($handle);
chmod('../wp-config.php', 0666);
display_header();
?>
<p>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 <a href="install.php">run the install!</a></p>
<?php

View File

@ -1241,9 +1241,11 @@ function wp_die( $message, $title = '' ) {
$admin_dir = 'wp-admin/';
if ( !function_exists('did_action') || !did_action('admin_head') ) :
status_header(500);
nocache_headers();
header('Content-Type: text/html; charset=utf-8');
if( !headers_sent() ){
status_header(500);
nocache_headers();
header('Content-Type: text/html; charset=utf-8');
}
if ( empty($title) ){
if( function_exists('__') )