WordPress.org

Make WordPress Core

Ticket #12065: 12065.diff

File 12065.diff, 1.9 KB (added by nacin, 4 years ago)
  • wp-includes/load.php

     
    319319 * @since 3.0.0 
    320320 */ 
    321321function wp_start_object_cache() { 
    322         global $_wp_using_ext_object_cache; 
    323         if ( file_exists( WP_CONTENT_DIR . '/object-cache.php' ) ) { 
    324                 require_once ( WP_CONTENT_DIR . '/object-cache.php' ); 
    325                 $_wp_using_ext_object_cache = true; 
    326         } else { 
    327                 require_once ( ABSPATH . WPINC . '/cache.php' ); 
    328                 $_wp_using_ext_object_cache = false; 
     322        if ( ! function_exists( 'wp_cache_init' ) ) { 
     323                global $_wp_using_ext_object_cache; 
     324                if ( file_exists( WP_CONTENT_DIR . '/object-cache.php' ) ) { 
     325                        require_once ( WP_CONTENT_DIR . '/object-cache.php' ); 
     326                        $_wp_using_ext_object_cache = true; 
     327                } else { 
     328                        require_once ( ABSPATH . WPINC . '/cache.php' ); 
     329                        $_wp_using_ext_object_cache = false; 
     330                } 
    329331        } 
    330332 
    331333        wp_cache_init(); 
  • wp-includes/ms-load.php

     
    2424if ( empty($PHP_SELF) || ( empty($PHP_SELF) && !is_subdomain_install() && $current_blog->path != '/' ) ) 
    2525        $_SERVER['PHP_SELF'] = $PHP_SELF = preg_replace("/(\?.*)?$/",'',$_SERVER["REQUEST_URI"]); 
    2626 
    27 wp_cache_init(); // need to init cache again after blog_id is set 
    28 if ( function_exists('wp_cache_add_global_groups') ) { // need to add these again. Yes, it's an ugly hack 
    29         wp_cache_add_global_groups(array ('users', 'userlogins', 'usermeta', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss')); 
    30         wp_cache_add_non_persistent_groups(array( 'comment', 'counts', 'plugins' )); 
    31 } 
     27// need to init cache again after blog_id is set 
     28wp_start_object_cache(); 
    3229 
    3330if ( !defined( 'UPLOADBLOGSDIR' ) ) 
    3431        define( 'UPLOADBLOGSDIR', 'wp-content/blogs.dir' );