]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/install-helper.php
WordPress 4.0-scripts
[autoinstalls/wordpress.git] / wp-admin / install-helper.php
index c98b28cc30d29869e6511bd3d1629c7192746068..9d241d298a91f5301a73891c63bf2731166c1194 100644 (file)
@@ -43,8 +43,7 @@ if ( ! function_exists('maybe_create_table') ) :
  * Create database table, if it doesn't already exist.
  *
  * @since 1.0.0
- * @package WordPress
- * @subpackage Plugin
+ *
  * @uses $wpdb
  *
  * @param string $table_name Database table name.
@@ -58,9 +57,10 @@ function maybe_create_table($table_name, $create_ddl) {
                        return true;
                }
        }
-       //didn't find it try to create it.
+       // Didn't find it, so try to create it.
        $wpdb->query($create_ddl);
-       // we cannot directly tell that whether this succeeded!
+
+       // We cannot directly tell that whether this succeeded!
        foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) {
                if ($table == $table_name) {
                        return true;
@@ -75,8 +75,7 @@ if ( ! function_exists('maybe_add_column') ) :
  * Add column to database table, if column doesn't already exist in table.
  *
  * @since 1.0.0
- * @package WordPress
- * @subpackage Plugin
+ *
  * @uses $wpdb
  *
  * @param string $table_name Database table name
@@ -92,9 +91,11 @@ function maybe_add_column($table_name, $column_name, $create_ddl) {
                        return true;
                }
        }
-       //didn't find it try to create it.
+
+       // Didn't find it, so try to create it.
        $wpdb->query($create_ddl);
-       // we cannot directly tell that whether this succeeded!
+
+       // We cannot directly tell that whether this succeeded!
        foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {
                if ($column == $column_name) {
                        return true;
@@ -108,8 +109,7 @@ endif;
  * Drop column from database table, if it exists.
  *
  * @since 1.0.0
- * @package WordPress
- * @subpackage Plugin
+ *
  * @uses $wpdb
  *
  * @param string $table_name Table name
@@ -121,9 +121,11 @@ function maybe_drop_column($table_name, $column_name, $drop_ddl) {
        global $wpdb;
        foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {
                if ($column == $column_name) {
-                       //found it try to drop it.
+
+                       // Found it, so try to drop it.
                        $wpdb->query($drop_ddl);
-                       // we cannot directly tell that whether this succeeded!
+
+                       // We cannot directly tell that whether this succeeded!
                        foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {
                                if ($column == $column_name) {
                                        return false;
@@ -131,7 +133,7 @@ function maybe_drop_column($table_name, $column_name, $drop_ddl) {
                        }
                }
        }
-       // else didn't find it
+       // Else didn't find it.
        return true;
 }
 
@@ -152,8 +154,6 @@ function maybe_drop_column($table_name, $column_name, $drop_ddl) {
  *      Extra
  *
  * @since 1.0.0
- * @package WordPress
- * @subpackage Plugin
  *
  * @param string $table_name Table name
  * @param string $col_name Column name
@@ -172,7 +172,8 @@ function check_column($table_name, $col_name, $col_type, $is_null = null, $key =
        foreach ($results as $row ) {
 
                if ($row->Field == $col_name) {
-                       // got our column, check the params
+
+                       // Got our column, check the params.
                        if (($col_type != null) && ($row->Type != $col_type)) {
                                ++$diffs;
                        }