diff -r 2f6f6f7551ca -r 32102edaa81b web/wp-admin/install-helper.php --- a/web/wp-admin/install-helper.php Thu Sep 16 15:45:36 2010 +0000 +++ b/web/wp-admin/install-helper.php Mon Nov 19 18:26:13 2012 +0100 @@ -10,9 +10,6 @@ * needing to use these functions a lot, you might experience time outs. If you * do, then it is advised to just write the SQL code yourself. * - * You can turn debugging on, by setting $debug to 1 after you include this - * file. - * * * check_column('wp_links', 'link_description', 'mediumtext'); * if (check_column($wpdb->comments, 'comment_author', 'tinytext')) @@ -38,31 +35,14 @@ * @subpackage Plugin */ -/** - * @global bool $wp_only_load_config - * @name $wp_only_load_config - * @var bool - * @since unknown - */ -$wp_only_load_config = true; - /** Load WordPress Bootstrap */ require_once(dirname(dirname(__FILE__)).'/wp-load.php'); -/** - * Turn debugging on or off. - * @global bool|int $debug - * @name $debug - * @var bool|int - * @since unknown - */ -$debug = 0; - if ( ! function_exists('maybe_create_table') ) : /** * Create database table, if it doesn't already exist. * - * @since unknown + * @since 1.0.0 * @package WordPress * @subpackage Plugin * @uses $wpdb @@ -94,11 +74,10 @@ /** * Add column to database table, if column doesn't already exist in table. * - * @since unknown + * @since 1.0.0 * @package WordPress * @subpackage Plugin * @uses $wpdb - * @uses $debug * * @param string $table_name Database table name * @param string $column_name Table column name @@ -106,9 +85,8 @@ * @return bool False on failure. True, if already exists or was successful. */ function maybe_add_column($table_name, $column_name, $create_ddl) { - global $wpdb, $debug; + global $wpdb; foreach ($wpdb->get_col("DESC $table_name",0) as $column ) { - if ($debug) echo("checking $column == $column_name
"); if ($column == $column_name) { return true; @@ -129,7 +107,7 @@ /** * Drop column from database table, if it exists. * - * @since unknown + * @since 1.0.0 * @package WordPress * @subpackage Plugin * @uses $wpdb @@ -173,7 +151,7 @@ * Default * Extra * - * @since unknown + * @since 1.0.0 * @package WordPress * @subpackage Plugin * @@ -187,16 +165,14 @@ * @return bool True, if matches. False, if not matching. */ function check_column($table_name, $col_name, $col_type, $is_null = null, $key = null, $default = null, $extra = null) { - global $wpdb, $debug; + global $wpdb; $diffs = 0; $results = $wpdb->get_results("DESC $table_name"); foreach ($results as $row ) { - if ($debug > 1) print_r($row); if ($row->Field == $col_name) { // got our column, check the params - if ($debug) echo ("checking $row->Type against $col_type\n"); if (($col_type != null) && ($row->Type != $col_type)) { ++$diffs; } @@ -213,7 +189,6 @@ ++$diffs; } if ($diffs > 0) { - if ($debug) echo ("diffs = $diffs returning false\n"); return false; } return true; @@ -221,5 +196,3 @@ } return false; } - -?>