New wp-config.php setup by Chris Anderson, updated style for upgrade files, and brought install.php up to date with current version.

git-svn-id: http://svn.automattic.com/wordpress/trunk@664 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2003-12-30 09:31:13 +00:00
parent 3a2f87a2d4
commit b88f340791
4 changed files with 157 additions and 7 deletions

143
wp-admin/install-config.php Normal file
View File

@ -0,0 +1,143 @@
<?php
$_wp_installing = 1;
if (file_exists('../wp-config.php')) die("The file 'wp-config.php already exists. If you need to reset any of the configuration items in this file, please delete it first.");
$step = $HTTP_GET_VARS['step'];
if (!$step) $step = 0;
?>
<!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">
<head>
<title>WordPress &rsaquo; Setup Configuration File</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style media="screen" type="text/css">
<!--
body {
font-family: Georgia, "Times New Roman", Times, serif;
margin-left: 15%;
margin-right: 15%;
}
#logo {
margin: 0;
padding: 0;
background-image: url(http://wordpress.org/images/logo.png);
background-repeat: no-repeat;
height: 60px;
border-bottom: 4px solid #333;
}
#logo a {
display: block;
height: 60px;
}
#logo a span {
display: none;
}
p, li {
line-height: 140%;
}
-->
</style>
</head>
<body>
<h1 id="logo"><a href="http://wordpress.org"><span>WordPress</span></a></h1>
<?php
switch($step) {
case 0:
?>
<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>
<ol>
<li>Database name</li>
<li>Database username</li>
<li>Database password</li>
<li>Database host</li>
<li>Table prefix (if you want to run more than one WordPress in a single database) </li>
</ol>
<p>In all likelyhood, these items were supplied to you by your ISP. If you do not have this information, then you will need to contact them before you can continue. If you&#8217;re all ready, <a href="install-config.php?step=1">let&#8217;s go</a>! </p>
<?php
break;
case 1:
?>
</p>
<form method="post" action="install-config.php?step=2">
<p>Below you should enter your database connection details. If you're not sure about these, contact your host. </p>
<table>
<tr>
<th scope="row">Database Name</th>
<td><input name="dbname" type="text" size="45" value="wordpress" /></td>
<td>The name of the database you want to run WP in. </td>
</tr>
<tr>
<th scope="row">User Name</th>
<td><input name="uname" type="text" size="45" value="username" /></td>
<td>Your MySQL username</td>
</tr>
<tr>
<th scope="row">Password</th>
<td><input name="pwd" type="text" size="45" value="password" /></td>
<td>...and MySQL password.</td>
</tr>
<tr>
<th scope="row">Database Host</th>
<td><input name="dbhost" type="text" size="45" value="localhost" /></td>
<td>99% chance you won't need to change this value.</td>
</tr>
<tr>
<th scope="row">Table Prefix</th>
<td><input name="prefix" type="text" id="prefix" value="wp_" size="45" /></td>
<td>If you want to run multiple WordPress installations in a single database, change this.</td>
</tr>
</table>
<input name="submit" type="submit" value="Submit" />
</form>
<?php
break;
case 2:
$dbname = $HTTP_POST_VARS['dbname'];
$uname = $HTTP_POST_VARS['uname'];
$passwrd = $HTTP_POST_VARS['pwd'];
$dbhost = $HTTP_POST_VARS['dbhost'];
$prefix = $HTTP_POST_VARS['prefix'];
if (empty($prefix)) $prefix = 'wp_';
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.');
$configFile = file('../wp-config-sample.php');
$handle = fopen('../wp-config.php', 'w');
foreach ($configFile as $line_num => $line) {
switch (substr($line,0,16)) {
case "define('DB_NAME'":
fwrite($handle, str_replace("wordpress", $dbname, $line));
break;
case "define('DB_USER'":
fwrite($handle, str_replace("'username'", "'$uname'", $line));
break;
case "define('DB_PASSW":
fwrite($handle, str_replace("'password'", "'$passwrd'", $line));
break;
case "define('DB_HOST'":
fwrite($handle, str_replace("localhost", $dbhost, $line));
break;
case '$table_prefix ':
fwrite($handle, str_replace('wp_', $prefix, $line));
break;
default:
fwrite($handle, $line);
}
}
fclose($handle);
chmod('../wp-config.php', 0666);
?>
<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
break;
}
?>
</body>
</html>

View File

@ -1,15 +1,15 @@
<?php
$_wp_installing = 1;
if (!file_exists('../wp-config.php')) die("There doesn't seem to be a wp-config.php file. Double check that you updated wp-config.sample.php with the proper database connection information and renamed it to wp-config.php.");
if (!file_exists('../wp-config.php')) die("There doesn't seem to be a wp-config.php file. You must <a href='install-config.php'>create one</a> before moving on.");
require_once('../wp-config.php');
require('upgrade-functions.php');
$step = $HTTP_GET_VARS['step'];
if (!$step) $step = 0;
?>
<!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">
<title>WordPress &#8212; Installation</title>
<title>WordPress &rsaquo; Installation</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style media="screen" type="text/css">
<!--
@ -23,12 +23,12 @@ if (!$step) $step = 0;
padding: 0;
background-image: url(http://wordpress.org/images/wordpress.gif);
background-repeat: no-repeat;
height: 72px;
height: 60px;
border-bottom: 4px solid #333;
}
#logo a {
display: block;
height: 72px;
height: 60px;
}
#logo a span {
display: none;
@ -712,6 +712,10 @@ $random_password = substr(md5(uniqid(microtime())),0,6);
$query = "INSERT INTO $tableusers (ID, user_login, user_pass, user_firstname, user_lastname, user_nickname, user_icq, user_email, user_url, user_ip, user_domain, user_browser, dateYMDhour, user_level, user_aim, user_msn, user_yim, user_idmode) VALUES ( '1', 'admin', '$random_password', '', '', 'admin', '0', '$admin_email', '', '127.0.0.1', '127.0.0.1', '', '00-00-0000 00:00:01', '10', '', '', '', 'nickname')";
$q = $wpdb->query($query);
// Do final updates
upgrade_071();
upgrade_072();
upgrade_100();
?>
<p>User setup successful!</p>

View File

@ -587,6 +587,9 @@ function upgrade_100() {
$wpdb->query("UPDATE $tableoptions SET option_value = REPLACE(option_value, 'wp-links/links-images/', 'wp-images/links/')
WHERE option_name LIKE 'links_rating_image%'
AND option_value LIKE 'wp-links/links-images/%'");
$wpdb->query("DELETE FROM $tableoptions WHERE option_name = 'comment_allowed_tags'");
$wpdb->query("DELETE FROM $tableoptions WHERE option_name = 'use_preview'");
$wpdb->query("DELETE FROM $tableoptions WHERE option_name = 'search_engine_friendly_urls'");
// Multiple categories
maybe_create_table($tablepost2cat, "
CREATE TABLE `$tablepost2cat` (

View File

@ -22,14 +22,14 @@ if (!$step) $step = 0;
padding: 0;
background-image: url(http://wordpress.org/images/logo.png);
background-repeat: no-repeat;
height: 54px;
height: 60px;
border-bottom: 4px solid #333;
}
#logo a {
display: block;
text-decoration: none;
text-indent: -100em;
height: 54px;
height: 60px;
}
p {
line-height: 140%;