]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/install-helper.php
Wordpress 2.6.2-scripts
[autoinstalls/wordpress.git] / wp-admin / install-helper.php
index ecfc91d5572f63c4f990f8aa8b675c0cbc218f05..eebe0e3e9d6bdee994f163f6f252cc6e78a37703 100644 (file)
@@ -1,5 +1,6 @@
 <?php
-require_once('../wp-config.php');
+$wp_only_load_config = true;
+require_once(dirname(dirname(__FILE__)).'/wp-load.php');
 $debug = 0;
 
 /**
@@ -8,6 +9,7 @@ $debug = 0;
  ** Returns:  true if already exists or on successful completion
  **           false on error
  */
+if ( ! function_exists('maybe_create_table') ) :
 function maybe_create_table($table_name, $create_ddl) {
        global $wpdb;
        foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) {
@@ -16,7 +18,7 @@ function maybe_create_table($table_name, $create_ddl) {
                }
        }
        //didn't find it try to create it.
-       $q = $wpdb->query($create_ddl);
+       $wpdb->query($create_ddl);
        // we cannot directly tell that whether this succeeded!
        foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) {
                if ($table == $table_name) {
@@ -25,6 +27,7 @@ function maybe_create_table($table_name, $create_ddl) {
        }
        return false;
 }
+endif;
 
 /**
  ** maybe_add_column()
@@ -32,6 +35,7 @@ function maybe_create_table($table_name, $create_ddl) {
  ** Returns:  true if already exists or on successful completion
  **           false on error
  */
+if ( ! function_exists('maybe_add_column') ) :
 function maybe_add_column($table_name, $column_name, $create_ddl) {
        global $wpdb, $debug;
        foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {
@@ -41,7 +45,7 @@ function maybe_add_column($table_name, $column_name, $create_ddl) {
                        }
        }
        //didn't find it try to create it.
-       $q = $wpdb->query($create_ddl);
+       $wpdb->query($create_ddl);
        // we cannot directly tell that whether this succeeded!
        foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {
                if ($column == $column_name) {
@@ -50,7 +54,7 @@ function maybe_add_column($table_name, $column_name, $create_ddl) {
        }
        return false;
 }
-
+endif;
 
 /**
  ** maybe_drop_column()
@@ -63,7 +67,7 @@ function maybe_drop_column($table_name, $column_name, $drop_ddl) {
        foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {
                if ($column == $column_name) {
                        //found it try to drop it.
-                       $q = $wpdb->query($drop_ddl);
+                       $wpdb->query($drop_ddl);
                        // we cannot directly tell that whether this succeeded!
                        foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {
                                if ($column == $column_name) {
@@ -149,4 +153,4 @@ if (check_column($wpdb->links, 'link_description', 'varchar(255)')) {
 }
 echo "</pre>";
 */
-?>
\ No newline at end of file
+?>