WordPress.org

Plugin Directory

Changeset 632434


Ignore:
Timestamp:
11/30/12 21:52:23 (17 months ago)
Author:
markjaquith
Message:

Attempt to gracefully degrade to the built-in object cache backend if APC is not available.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apc/trunk/object-cache.php

    r626546 r632434  
    33Plugin Name: APC Object Cache 
    44Description: APC backend for the WP Object Cache. 
    5 Version: 2.0.4 
     5Version: 2.0.5-beta 
    66URI: http://txfx.net/wordpress-plugins/apc/ 
    77Author: Mark Jaquith 
     
    1515*/ 
    1616 
    17 if ( !function_exists( 'apc_fetch' ) ) { 
    18     wp_die( 'You do not have APC installed, so you cannot use the APC object cache backend. Please remove the <code>object-cache.php</code> file from your content directory.' ); 
    19 } elseif ( version_compare( '5.2.4', phpversion(), '>=' ) ) { 
     17if ( function_exists( 'apc_fetch' ) ) : 
     18 
     19if ( version_compare( '5.2.4', phpversion(), '>=' ) ) { 
    2020    wp_die( 'The APC object cache backend requires PHP 5.2 or higher. You are running ' . phpversion() . '. Please remove the <code>object-cache.php</code> file from your content directory.' ); 
    2121} 
     
    368368 
    369369} // !function_exists( 'wp_cache_add' ) 
     370 
     371else : // No APC 
     372    function apc_not_actually_running() { 
     373        $GLOBALS['_wp_using_ext_object_cache'] = false; 
     374        unset( $GLOBALS['wp_filter']['all'][-100]['apc_not_actually_running'] ); 
     375    } 
     376    $GLOBALS['_wp_using_ext_object_cache'] = false; // This will get overridden as of WP 3.5, so we have to hook in to 'all': 
     377    $GLOBALS['wp_filter']['all'][-100]['apc_not_actually_running'] = array( 'function' => 'apc_not_actually_running', 'accepted_args' => 0 ); 
     378    require_once ( ABSPATH . WPINC . '/cache.php' ); 
     379endif; 
Note: See TracChangeset for help on using the changeset viewer.