Introduce wp_using_ext_object_cache() - mimic wp_suspend_cache_invalidation() and discourage direct access to $_wp_using_ext_object_cache, cleaning up importing of globals in functions and provides function to modify that global. Loads the packaged object cache when an external cache hasn't been loaded or doesn't contain wp_cache_init().

Fixes #21401.


Built from https://develop.svn.wordpress.org/trunk@25289


git-svn-id: http://core.svn.wordpress.org/trunk@25253 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor
2013-09-06 18:10:09 +00:00
parent 74092c3960
commit d7cc1f506a
5 changed files with 41 additions and 35 deletions

View File

@@ -28,10 +28,10 @@ if ( !defined('ABSPATH') ) {
// Uncached doing_cron transient fetch
function _get_cron_lock() {
global $_wp_using_ext_object_cache, $wpdb;
global $wpdb;
$value = 0;
if ( $_wp_using_ext_object_cache ) {
if ( wp_using_ext_object_cache() ) {
// Skip local cache and force refetch of doing_cron transient in case
// another processs updated the cache
$value = wp_cache_get( 'doing_cron', 'transient', true );