WordPress 4.0
[autoinstalls/wordpress.git] / wp-admin / install-helper.php
index c654a92b061dfa1170217931b78d5daa89a10278..9d241d298a91f5301a73891c63bf2731166c1194 100644 (file)
@@ -57,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;
@@ -90,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;
@@ -118,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;
@@ -128,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;
 }
 
@@ -167,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;
                        }