-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support WP-Stash in 'wp cache type' #68
Comments
Thanks for the suggestion, @Biont ! I'd be happy to accept a PR for what you're suggesting.
If a
Sure! Feel free to submit that as a second PR if you'd like. |
Related wp-cli/wp-cli#5735 |
This will prove more extensible that the current method. |
I think this needs to exist in core first. I don't want to introduce support for something official-looking, only to have core implement some different approach. |
Opened https://core.trac.wordpress.org/ticket/58808 for that proposal |
@swissspidy I worked a bit with @johnbillion on a spec for object cache information, in form of |
Yeah https://github.com/rhubarbgroup/wp-object-cache-info-spec was just mentioned to me today. I think I'm the wrong one to collaborate on that though, as I am not really familiar with all the object cache stuff. |
Greetings.
I just looked around the
wp cache type
command after seeing it returns "Unknown" in our WP instances running WP Stash. I think it would be pretty useful if we could see that a site is indeed running WP-Stash - and possibly which driver is in use.I see that determining the cache type is a "manual" process that checks for the specifics of several implementations. So would you be supportive of adding WP Stash to the list of implementations to check against?
The most basic check would probably be
class_exists('Inpsyde\WpStash\WpStash')
and it could returnget_class( WpStash::instance()->driver() )
. This would yield the FQCN of the StashPHP driver that is currently being used.I hope you consider this a worthwhile addition - which I'd happily PR your way.
As a side note: Wouldn't it make sense to provide a generic way for implementations to TELL wp-cli what's being used? The ideal solution would be of course if WP-Core had such a thing on offer, but in the absence of this: is there an inherent problem with checking for the existence of
$wp_object_cache->type
- or maybe even callingwp_cache_type()
if it exists?In addition, maybe you could return
'Unknown: ' . get_class( $wp_object_cache )
, so users with entirely custom solutions would at least get some result.The text was updated successfully, but these errors were encountered: