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.



git-svn-id: https://develop.svn.wordpress.org/trunk@25289 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2013-09-06 18:09:24 +00:00
parent 6bad3b660a
commit 22278ec6a9
5 changed files with 41 additions and 35 deletions
+2 -2
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 );