Make WordPress Core

Changeset 3011 for trunk/wp-settings.php


Ignore:
Timestamp:
11/07/2005 09:56:03 PM (19 years ago)
Author:
ryan
Message:

Object caching, round one.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-settings.php

    r2818 r3011  
    2121$HTTP_USER_AGENT = getenv('HTTP_USER_AGENT');
    2222unset( $wp_filter, $cache_userdata, $cache_lastcommentmodified, $cache_lastpostdate, $cache_settings, $category_cache, $cache_categories );
     23
     24if ( ! isset($blog_id) )
     25    $blog_id = 1;
    2326
    2427// Fix for IIS, which doesn't set REQUEST_URI
     
    7578if ( defined('CUSTOM_USER_META_TABLE') )
    7679    $wpdb->usermeta = CUSTOM_USER_META_TABLE;
    77    
     80
    7881// We're going to need to keep this around for a few months even though we're not using it internally
    7982
     
    8891$tablepostmeta = $wpdb->postmeta;
    8992
     93if ( file_exists(ABSPATH . 'wp-content/object-cache.php') )
     94    require (ABSPATH . 'wp-content/object-cache.php');
     95else
     96    require (ABSPATH . WPINC . '/cache.php');
     97
     98// For now, disable persistent caching by default.  To enable, comment out
     99// the following line.
     100define('DISABLE_CACHE', true);
     101
     102wp_cache_init();
     103
    90104$wp_filters = array();
    91105
     
    95109
    96110$wpdb->hide_errors();
    97 if ( !update_category_cache() && (!strstr($_SERVER['PHP_SELF'], 'install.php') && !defined('WP_INSTALLING')) ) {
     111$db_check = $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = 'siteurl'");
     112if ( !$db_check && (!strstr($_SERVER['PHP_SELF'], 'install.php') && !defined('WP_INSTALLING')) ) {
    98113    if ( strstr($_SERVER['PHP_SELF'], 'wp-admin') )
    99114        $link = 'install.php';
     
    195210
    196211function shutdown_action_hook() {
     212    wp_cache_close();
    197213    do_action('shutdown');
    198214}
Note: See TracChangeset for help on using the changeset viewer.