X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/69ac90aac5f1f0c980444b182c6d03659fbc7e7a..8a06f4f9392d1ac373442f82ee40428a3cb81395:/wp-admin/install-helper.php diff --git a/wp-admin/install-helper.php b/wp-admin/install-helper.php index b53376eb..eebe0e3e 100644 --- a/wp-admin/install-helper.php +++ b/wp-admin/install-helper.php @@ -1,5 +1,6 @@ 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) {