Skip to content

Warn when wp transient list is used with external object cache #82

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

Merged
merged 1 commit into from
Feb 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/Transient_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,10 @@ public function type() {
public function list_( $args, $assoc_args ) {
global $wpdb;

if ( wp_using_ext_object_cache() ) {
WP_CLI::warning( 'Transients are stored in an external object cache, and this command only shows those stored in the database.' );
}

$network = Utils\get_flag_value( $assoc_args, 'network', false );
$unserialize = Utils\get_flag_value( $assoc_args, 'unserialize', false );
$human_readable = Utils\get_flag_value( $assoc_args, 'human-readable', false );
Expand Down