Changeset 19935 for trunk/wp-admin/install-helper.php
- Timestamp:
- 02/17/2012 12:02:42 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/install-helper.php
r19712 r19935 10 10 * needing to use these functions a lot, you might experience time outs. If you 11 11 * do, then it is advised to just write the SQL code yourself. 12 *13 * You can turn debugging on, by setting $debug to 1 after you include this14 * file.15 12 * 16 13 * <code> … … 41 38 /** Load WordPress Bootstrap */ 42 39 require_once(dirname(dirname(__FILE__)).'/wp-load.php'); 43 44 /**45 * Turn debugging on or off.46 * @global bool|int $debug47 * @name $debug48 * @var bool|int49 * @since 1.0.050 */51 $debug = 0;52 40 53 41 if ( ! function_exists('maybe_create_table') ) : … … 91 79 * @subpackage Plugin 92 80 * @uses $wpdb 93 * @uses $debug94 81 * 95 82 * @param string $table_name Database table name … … 99 86 */ 100 87 function maybe_add_column($table_name, $column_name, $create_ddl) { 101 global $wpdb , $debug;88 global $wpdb; 102 89 foreach ($wpdb->get_col("DESC $table_name",0) as $column ) { 103 if ($debug) echo("checking $column == $column_name<br />");104 90 105 91 if ($column == $column_name) { … … 180 166 */ 181 167 function check_column($table_name, $col_name, $col_type, $is_null = null, $key = null, $default = null, $extra = null) { 182 global $wpdb , $debug;168 global $wpdb; 183 169 $diffs = 0; 184 170 $results = $wpdb->get_results("DESC $table_name"); 185 171 186 172 foreach ($results as $row ) { 187 if ($debug > 1) print_r($row);188 173 189 174 if ($row->Field == $col_name) { 190 175 // got our column, check the params 191 if ($debug) echo ("checking $row->Type against $col_type\n");192 176 if (($col_type != null) && ($row->Type != $col_type)) { 193 177 ++$diffs; … … 206 190 } 207 191 if ($diffs > 0) { 208 if ($debug) echo ("diffs = $diffs returning false\n");209 192 return false; 210 193 }
Note: See TracChangeset
for help on using the changeset viewer.