From d9ccee1c606744321c1de066a6fb3724f734d359 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Till=20Kru=CC=88ss?= Date: Mon, 19 Sep 2016 10:19:00 -0700 Subject: [PATCH] Added WP-CLI command docs --- README.md | 26 ++++++++++++++++++++++++++ includes/wp-cli-commands.php | 14 +++++++++++--- readme.txt | 25 +++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index dd30c85b..1dd715c0 100644 --- a/README.md +++ b/README.md @@ -98,3 +98,29 @@ define( 'WP_REDIS_CLUSTER', [ 'tcp://127.0.0.2:6379?database=15&alias=node-02', ] ); ``` + +### WP-CLI Commands + +To use the WP-CLI commands, make sure the plugin is activated: + +``` +wp plugin activate redis-cache +``` + +The following commands are supported: + +* `wp redis status` + + Show the Redis object cache status and (when possible) client. + +* `wp redis enable` + + Enables the Redis object cache. Default behavior is to create the object cache drop-in, unless an unknown object cache drop-in is present. + +* `wp redis disable` + + Disables the Redis object cache. Default behavior is to delete the object cache drop-in, unless an unknown object cache drop-in is present. + +* `wp redis update-dropin` + + Updates the Redis object cache drop-in. Default behavior is to overwrite any existing object cache drop-in. diff --git a/includes/wp-cli-commands.php b/includes/wp-cli-commands.php index a621fe65..4773f158 100644 --- a/includes/wp-cli-commands.php +++ b/includes/wp-cli-commands.php @@ -5,7 +5,7 @@ class RedisObjectCache_CLI_Commands extends WP_CLI_Command { /** - * Show the Redis object cache status. + * Show the Redis object cache status and (when possible) client. * * ## EXAMPLES * @@ -42,6 +42,9 @@ public function status() { /** * Enables the Redis object cache. * + * Default behavior is to create the object cache drop-in, + * unless an unknown object cache drop-in is present. + * * ## EXAMPLES * * wp redis enable @@ -76,7 +79,10 @@ public function enable() { } /** - * Disabled the Redis object cache. + * Disables the Redis object cache. + * + * Default behavior is to delete the object cache drop-in, + * unless an unknown object cache drop-in is present. * * ## EXAMPLES * @@ -116,7 +122,9 @@ public function disable() { } /** - * Updates the Redis object cache dropin. + * Updates the Redis object cache drop-in. + * + * Default behavior is to overwrite any existing object cache drop-in. * * ## EXAMPLES * diff --git a/readme.txt b/readme.txt index 5b31b97c..a5bf2a93 100644 --- a/readme.txt +++ b/readme.txt @@ -112,6 +112,31 @@ __Clustering via Client-side Sharding Example:__ ] ); +== WP-CLI Commands == + +To use the WP-CLI commands, make sure the plugin is activated: + + wp plugin activate redis-cache + +The following commands are supported: + + * `wp redis status` + + Show the Redis object cache status and (when possible) client. + + * `wp redis enable` + + Enables the Redis object cache. Default behavior is to create the object cache drop-in, unless an unknown object cache drop-in is present. + + * `wp redis disable` + + Disables the Redis object cache. Default behavior is to delete the object cache drop-in, unless an unknown object cache drop-in is present. + + * `wp redis update-dropin` + + Updates the Redis object cache drop-in. Default behavior is to overwrite any existing object cache drop-in. + + == Screenshots == 1. Plugin settings, connected to a single Redis server.