Skip to content

Commit

Permalink
Do not declare cache functions on WP_STASH_BYPASS
Browse files Browse the repository at this point in the history
an early return in object-cache.php won't avoid wp_cache*
to be declared anyway
  • Loading branch information
dnaber-de committed Oct 28, 2020
1 parent e3cbb74 commit bda46dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 1 addition & 5 deletions dropin/object-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@
* @link https://github.com/WordPress/WordPress/blob/32d193f96fea928a487e51698fd1861bf6c66978/wp-includes/load.php#L649-L651
*/

if (getenv('WP_STASH_BYPASS') !== false) {
return;
}

/**
* Adds data to the cache, if the cache key doesn't already exist.
*
Expand Down Expand Up @@ -316,4 +312,4 @@ function wp_cache_get_multiple($keys, $group = '', $force = false)
assert($wp_object_cache instanceof ObjectCacheProxy);

return $wp_object_cache->get_multiple($keys, $group, $force);
}
}
4 changes: 3 additions & 1 deletion src/WpStash.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@ private function ensureDropIn(): bool
unlink(__FILE__);
return;
}
require_once '%1$s';
if (filter_var(getenv('WP_STASH_BYPASS'), FILTER_VALIDATE_BOOL) === false) {
require_once '%1$s';
}

PHPCODE
,
Expand Down

0 comments on commit bda46dd

Please sign in to comment.