Permalink
Browse files

Installation cleanup.

git-svn-id: http://svn.automattic.com/wordpress/trunk@672 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
1 parent 9b48a9d commit edc7d7cd8cf732cad475520dc6ea80c737cb30c9 saxmatt committed Dec 31, 2003
Showing with 27 additions and 9 deletions.
  1. +1 −1 wp-admin/install-config.php
  2. +9 −2 wp-admin/install.php
  3. +3 −1 wp-admin/upgrade-functions.php
  4. +2 −1 wp-includes/functions.php
  5. +12 −4 wp-settings.php
@@ -123,7 +123,7 @@
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
@@ -656,8 +656,15 @@
<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
@@ -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();
@@ -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
@@ -17,13 +17,19 @@
$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 @@
// 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 @@
} //end !$_wp_installing
+
+
require (ABSPATH . WPINC . '/vars.php');
?>

0 comments on commit edc7d7c

Please sign in to comment.