diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2008-06-05 17:01:06 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2008-06-05 17:01:06 +0000 |
commit | ea7e2672ca23b81d1f79f60e077929433fe9ae77 (patch) | |
tree | 7f8b75d36ff75301d0cb28ad361b38a2ea1fb746 /wp-settings.php | |
parent | 166dbfef77ed975acc7b722279be0c0c96e2d039 (diff) | |
download | wordpress-mu-ea7e2672ca23b81d1f79f60e077929433fe9ae77.tar.gz wordpress-mu-ea7e2672ca23b81d1f79f60e077929433fe9ae77.tar.xz wordpress-mu-ea7e2672ca23b81d1f79f60e077929433fe9ae77.zip |
Cleanup init process
Initialize the object cache sooner so sunrise.php can use it.
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1322 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-settings.php')
-rw-r--r-- | wp-settings.php | 51 |
1 files changed, 13 insertions, 38 deletions
diff --git a/wp-settings.php b/wp-settings.php index e02c967..b81dc9a 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -201,68 +201,43 @@ if ( !defined('PLUGINDIR') ) require (ABSPATH . WPINC . '/compat.php'); require (ABSPATH . WPINC . '/functions.php'); -require (ABSPATH . WPINC . '/classes.php'); require_wp_db(); - +$wpdb->set_prefix($table_prefix); // set up global tables if ( !empty($wpdb->error) ) dead_db(); -$prefix = $wpdb->set_prefix($table_prefix); +if ( !defined( 'WP_INSTALLING' ) && file_exists(ABSPATH . 'wp-content/object-cache.php') ) + require_once (ABSPATH . 'wp-content/object-cache.php'); +else + require_once (ABSPATH . WPINC . '/cache.php'); -if ( is_wp_error($prefix) ) - wp_die('<strong>ERROR</strong>: <code>$table_prefix</code> in <code>wp-config.php</code> can only contain numbers, letters, and underscores.'); -// Table names. prefix is bare "wp_" -$wpdb->blogs = $wpdb->prefix . 'blogs'; -$wpdb->site = $wpdb->prefix . 'site'; -$wpdb->sitemeta = $wpdb->prefix . 'sitemeta'; -$wpdb->sitecategories = $wpdb->prefix . 'sitecategories'; -$wpdb->signups = $wpdb->prefix . 'signups'; -$wpdb->registration_log = $wpdb->prefix . 'registration_log'; -$wpdb->blog_versions = $wpdb->prefix . 'blog_versions'; +wp_cache_init(); if( defined( 'SUNRISE' ) ) include_once( ABSPATH . 'wp-content/sunrise.php' ); require_once ( ABSPATH . 'wpmu-settings.php' ); -$prefix = $table_prefix; -$wpdb->prefix = $table_prefix; // prefix now includes a blog_id -$wpdb->posts = $wpdb->prefix . 'posts'; -$wpdb->categories = $wpdb->prefix . 'categories'; -$wpdb->post2cat = $wpdb->prefix . 'post2cat'; -$wpdb->comments = $wpdb->prefix . 'comments'; -$wpdb->link2cat = $wpdb->prefix . 'link2cat'; -$wpdb->links = $wpdb->prefix . 'links'; -$wpdb->linkcategories = $wpdb->prefix . 'linkcategories'; -$wpdb->options = $wpdb->prefix . 'options'; -$wpdb->postmeta = $wpdb->prefix . 'postmeta'; -$wpdb->terms = $wpdb->prefix . 'terms'; -$wpdb->term_taxonomy = $wpdb->prefix . 'term_taxonomy'; -$wpdb->term_relationships = $wpdb->prefix . 'term_relationships'; -$wpdb->siteid = $current_blog->site_id; $wpdb->blogid = $current_blog->blog_id; +$wpdb->siteid = $current_blog->site_id; +$wpdb->set_prefix($table_prefix); // set up blog tables +$table_prefix = $table_prefix . $blog_id . '_'; +wp_cache_init(); // need to init cache again after blog_id is set if ( defined('CUSTOM_USER_TABLE') ) $wpdb->users = CUSTOM_USER_TABLE; if ( defined('CUSTOM_USER_META_TABLE') ) $wpdb->usermeta = CUSTOM_USER_META_TABLE; -if ( !defined( 'WP_INSTALLING' ) && file_exists(ABSPATH . 'wp-content/object-cache.php') ) - require_once (ABSPATH . 'wp-content/object-cache.php'); -else - require_once (ABSPATH . WPINC . '/cache.php'); - -wp_cache_init(); - if( !defined( "UPLOADS" ) ) define( "UPLOADS", "wp-content/blogs.dir/{$wpdb->blogid}/files/" ); -require (ABSPATH . WPINC . '/plugin.php'); -require (ABSPATH . WPINC . '/default-filters.php'); - if( defined( "SHORTINIT" ) && constant( "SHORTINIT" ) == true ) // stop most of WP being loaded, we just want the basics return; +require (ABSPATH . WPINC . '/classes.php'); +require (ABSPATH . WPINC . '/plugin.php'); +require (ABSPATH . WPINC . '/default-filters.php'); include_once(ABSPATH . WPINC . '/streams.php'); include_once(ABSPATH . WPINC . '/gettext.php'); require_once (ABSPATH . WPINC . '/l10n.php'); |