Installation cleanup.

git-svn-id: http://svn.automattic.com/wordpress/trunk@672 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2003-12-31 23:51:41 +00:00
parent 9b48a9d723
commit edc7d7cd8c
5 changed files with 27 additions and 9 deletions

View File

@ -123,7 +123,7 @@ switch($step) {
case "define('DB_HOST'":
fwrite($handle, str_replace("localhost", $dbhost, $line));
break;
case '$table_prefix ':
case '$table_prefix =':
fwrite($handle, str_replace('wp_', $prefix, $line));
break;
default:

View File

@ -656,8 +656,15 @@ foreach ($geo_option_data as $query) {
<p>OK. We're nearly done now. We just need to ask you a couple of things:</p>
<form action="install.php?step=3" method="post">
<input type="hidden" name="step" value="3" />
<p>What is the url for your blog? <input name="url" type="text" size="60" />
, now on to <input type="submit" value="Step 3" ></p>
<p>What is the URL for your blog?<br />
<?php
$guessurl = str_replace('/wp-admin/install.php?step=2', '', 'http://' . $HTTP_HOST . $REQUEST_URI);
?>
<input name="url" type="text" size="60" value="<?php echo $guessurl; ?>" />
</p>
<p>On to
<input type="submit" value="Step 3..." />
</p>
</form>
<?php

View File

@ -455,7 +455,7 @@ function upgrade_072() {
}
function upgrade_100() {
global $wpdb, $tableposts, $tablecomments, $tablecategories, $tableoptionvalues, $tableoptiongroups, $tableoptiongroup_options, $tableoptions, $tablepost2cat;
global $wpdb, $tableposts, $tablecomments, $tablecategories, $tableoptionvalues, $tableoptiongroups, $tableoptiongroup_options, $tableoptions, $tablepost2cat, $tablelinks, $tableusers;
maybe_add_column($tableposts, 'post_name', "ALTER TABLE `$tableposts` ADD `post_name` VARCHAR(200) NOT NULL");
maybe_add_column($tableposts, 'to_ping', "ALTER TABLE $tableposts ADD `to_ping` TEXT NOT NULL");
maybe_add_column($tableposts, 'pinged', "ALTER TABLE $tableposts ADD `pinged` TEXT NOT NULL");
@ -464,6 +464,8 @@ function upgrade_100() {
maybe_add_column($tablecategories, 'category_nicename', "ALTER TABLE `$tablecategories` ADD `category_nicename` VARCHAR(200) NOT NULL");
maybe_add_column($tablecategories, 'category_description', "ALTER TABLE `$tablecategories` ADD `category_description` TEXT NOT NULL");
maybe_add_column($tablecategories, 'category_parent', "ALTER TABLE `$tablecategories` ADD `category_parent` INT(4) NOT NULL");
maybe_add_column($tablelinks, 'link_rss', "ALTER TABLE `$tablelinks` ADD `link_rss` VARCHAR( 255 ) NOT NULL;");
maybe_add_column($tableusers, 'user_description', "ALTER TABLE `$tableusers` ADD `user_description` TEXT NOT NULL");
// Create indicies
$wpdb->hide_errors();

View File

@ -541,7 +541,8 @@ function url_to_postid($url = '') {
/* Options functions */
function get_settings($setting) {
global $wpdb, $cache_settings, $use_cache;
global $wpdb, $cache_settings, $use_cache, $REQUEST_URI;
if (strstr($REQUEST_URI, 'install.php')) return false;
if ((empty($cache_settings)) OR (!$use_cache)) {
$settings = get_alloptions();
$cache_settings = $settings;

View File

@ -17,13 +17,19 @@ $tableoptiontypes = $table_prefix . 'optiontypes';
$tableoptionvalues = $table_prefix . 'optionvalues';
$tableoptiongroups = $table_prefix . 'optiongroups';
$tableoptiongroup_options = $table_prefix . 'optiongroup_options';
define('WPINC', 'wp-includes');
require (ABSPATH . WPINC . '/wp-db.php');
$wpdb->hide_errors();
if (!$wpdb->get_row("SELECT * FROM $tableoptions LIMIT 1") && !strstr($REQUEST_URI, 'install.php')) {
die("It doesn't look like you've installed WP yet. Try running <a href='wp-admin/install.php'>install.php</a>.");
}
$wpdb->show_errors();
// This is the name of the include directory. No "/" allowed.
define('WPINC', 'wp-includes');
require (ABSPATH . 'wp-config-extra.php');
require (ABSPATH . WPINC . '/wp-db.php');
require (ABSPATH . WPINC . '/functions.php');
require (ABSPATH . 'wp-config-extra.php');
require (ABSPATH . WPINC . '/template-functions.php');
require (ABSPATH . WPINC . '/class-xmlrpc.php');
require (ABSPATH . WPINC . '/class-xmlrpcs.php');
@ -35,7 +41,7 @@ require (ABSPATH . WPINC . '/kses.php');
// We should eventually migrate to either calling
// get_settings() wherever these are needed OR
// accessing a single global $all_settings var
if (!isset($_wp_installing) || !$_wp_installing) {
if (!strstr($REQUEST_URI, 'install.php')) {
$siteurl = get_settings('siteurl');
// "When trying to design a foolproof system,
// never underestimate the ingenuity of the fools :)"
@ -98,5 +104,7 @@ if (!isset($_wp_installing) || !$_wp_installing) {
} //end !$_wp_installing
require (ABSPATH . WPINC . '/vars.php');
?>