Prevent fatal error if plugin uses install-helper.php, fixes #6747 for 2.7

git-svn-id: http://svn.automattic.com/wordpress/trunk@8610 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2008-08-10 23:13:39 +00:00
parent 3b9b906d3e
commit efb38685f8
1 changed files with 4 additions and 1 deletions

View File

@ -9,6 +9,7 @@ $debug = 0;
** Returns: true if already exists or on successful completion ** Returns: true if already exists or on successful completion
** false on error ** false on error
*/ */
if ( ! function_exists('maybe_create_table') ) :
function maybe_create_table($table_name, $create_ddl) { function maybe_create_table($table_name, $create_ddl) {
global $wpdb; global $wpdb;
foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) { foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) {
@ -26,6 +27,7 @@ function maybe_create_table($table_name, $create_ddl) {
} }
return false; return false;
} }
endif;
/** /**
** maybe_add_column() ** maybe_add_column()
@ -33,6 +35,7 @@ function maybe_create_table($table_name, $create_ddl) {
** Returns: true if already exists or on successful completion ** Returns: true if already exists or on successful completion
** false on error ** false on error
*/ */
if ( ! function_exists('maybe_add_column') ) :
function maybe_add_column($table_name, $column_name, $create_ddl) { function maybe_add_column($table_name, $column_name, $create_ddl) {
global $wpdb, $debug; global $wpdb, $debug;
foreach ($wpdb->get_col("DESC $table_name",0) as $column ) { foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {
@ -51,7 +54,7 @@ function maybe_add_column($table_name, $column_name, $create_ddl) {
} }
return false; return false;
} }
endif;
/** /**
** maybe_drop_column() ** maybe_drop_column()