WordPoints / dev-lib

Developer tools for WordPoints projects
MIT License
4 stars 0 forks source link

wpcept: completely disable object caching #174

Closed JDGrimes closed 8 years ago

JDGrimes commented 8 years ago

We have thought that we were doing this with wp_suspend_cache_addition(), however, that function only suspends the use of wp_cache_add(), not wp_cache_set(). To entirely suspend caching, I think we'd have to override the built-in object cache in some way.

JDGrimes commented 8 years ago

I tried just overriding the $wp_object_cache->cache property. Even though it is private, WP_Object_Cache allows access via __get() for back-compat. However, it isn't possible to replace that array with a black-hole ArrayAccess object, because of issues with indirect modification:

[PHPUnit_Framework_Exception] Indirect modification of overloaded element...

So I guess we'll have to replace the whole $wp_object_cache global.