Introduce wpdb::tables() to fetch table names on a global or blog scope. Remove very old and long deprecated $table{table} globals, fixes #11614. See #12083

git-svn-id: https://develop.svn.wordpress.org/trunk@13229 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2010-02-19 19:57:03 +00:00
parent c94d1c04c0
commit d543b36622
4 changed files with 164 additions and 125 deletions
+3 -2
View File
@@ -1827,12 +1827,13 @@ function is_blog_installed() {
$tables = $wpdb->get_col('SHOW TABLES');
$wpdb->suppress_errors( $suppress );
$wp_tables = $wpdb->tables( 'all', true );
// Loop over the WP tables. If none exist, then scratch install is allowed.
// If one or more exist, suggest table repair since we got here because the options
// table could not be accessed.
foreach ($wpdb->tables as $table) {
foreach ( $wp_tables as $table ) {
// If one of the WP tables exist, then we are in an insane state.
if ( in_array($wpdb->prefix . $table, $tables) ) {
if ( in_array( $table, $tables ) ) {
// If visiting repair.php, return true and let it take over.
if ( defined('WP_REPAIRING') )
return true;