PHP Class WP_Redis_CLI_Command, wp-redis

Show file Open project: pantheon-systems/wp-redis

Public Methods

Method Description
cli ( ) Launch redis-cli using Redis configuration for WordPress
debug ( $_, $assoc_args ) Debug object cache hit / miss ratio for any page URL.
enable ( ) Enable WP Redis by creating the symlink for object-cache.php
info ( $_, $assoc_args ) Provide details on the Redis connection.

Private Methods

Method Description
get_relative_path ( $from, $to ) Get the relative path between two files
load_wordpress_with_template ( ) Runs through the entirety of the WP bootstrap process

Method Details

cli() public method

Launch redis-cli using Redis configuration for WordPress
public cli ( )

debug() public method

## OPTIONS [--url=] : Execute a request against a specified URL. Defaults to home_url( '/' ). [--format=] : Render the results in a particular format.
public debug ( $_, $assoc_args )

enable() public method

Enable WP Redis by creating the symlink for object-cache.php
public enable ( )

info() public method

## OPTIONS [--reset] : Reset Redis stats. Only affects lifetime_hitrate currently. [--field=] : Get the value of a particular field. [--format=] : Render results in a particular format. --- default: table options: - table - json - yaml --- ## EXAMPLES $ wp redis info +-------------------+-----------+ | Field | Value | +-------------------+-----------+ | status | connected | | used_memory | 529.25K | | uptime | 0 days | | key_count | 20 | | instantaneous_ops | 9/sec | | lifetime_hitrate | 53.42% | | redis_host | 127.0.0.1 | | redis_port | 6379 | | redis_auth | | | redis_database | 0 | +-------------------+-----------+ $ wp redis info --field=used_memory 529.38K $ wp redis info --reset Success: Redis stats reset.
public info ( $_, $assoc_args )