diff --git a/README.md b/README.md index 344779d4973e109eaaafec86768daecf7fc371eb..7107cd1d30fe89c033a1ff68a9119f8c4910674f 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Provides a WP-CLI command to schedule these events. A UI is under consideration. ### Where is command output captured? ### -`error_log()` is used to store WP-CLI's output (`STDOUT`, `STDERR`, and the exit code), along with basic timing information and the command that was executed. +The actions `wp_cli_cron_control_offload_run_success` and `wp_cli_cron_control_offload_run_error` are fired, allowing you to capture command output as your environment allows. ### Can this be used with commands that manipulate files? ### @@ -51,8 +51,10 @@ Regardless of whether the constant or filter is used, either should provide an a ``` array( - 'post', - 'site', + 'cli', + 'core', + 'eval', + 'eval-file', ) ``` @@ -64,10 +66,8 @@ Regardless of whether the constant or filter is used, either should provide an a ``` array( - 'cli', - 'core', - 'eval', - 'eval-file', + 'post', + 'site', ) ``` diff --git a/includes/class-cli.php b/includes/class-command.php similarity index 90% rename from includes/class-cli.php rename to includes/class-command.php index 0557985cee012bb4a6a5a3931c24c0b02a13ff17..85b1295d8c472a6a50c7385fefa022c803706f75 100644 --- a/includes/class-cli.php +++ b/includes/class-command.php @@ -1,6 +1,6 @@ <?php /** - * Class CLI + * Class Command * * @package WP_CLI_Cron_Control_Offload */ @@ -8,7 +8,7 @@ namespace Automattic\WP\WP_CLI_Cron_Control_Offload; if ( ! defined( 'WP_CLI' ) || ! \WP_CLI ) { - return false; + return; } use WP_CLI; @@ -17,7 +17,7 @@ use WP_CLI_Command; /** * Offload WP-CLI commands to cron */ -class CLI extends WP_CLI_Command { +class Command extends WP_CLI_Command { /** * Create an event to run a given WP-CLI command * @@ -50,4 +50,4 @@ class CLI extends WP_CLI_Command { } } -WP_CLI::add_command( CLI_NAMESPACE, __NAMESPACE__ . '\CLI' ); +WP_CLI::add_command( CLI_NAMESPACE, __NAMESPACE__ . '\Command' ); diff --git a/languages/wp-cli-cron-control-offload.pot b/languages/wp-cli-cron-control-offload.pot index 2d42d5f1d57c5cd5942a73706d92095e03ce4d4c..75ed636d2ff360ae842a44be26295f1cdbfa3d58 100644 --- a/languages/wp-cli-cron-control-offload.pot +++ b/languages/wp-cli-cron-control-offload.pot @@ -5,7 +5,7 @@ msgstr "" "Project-Id-Version: WP-CLI Cron Control Offload 0.1.0\n" "Report-Msgid-Bugs-To: " "https://wordpress.org/support/plugin/wp-cli-cron-control-offload\n" -"POT-Creation-Date: 2017-09-14 02:19:58+00:00\n" +"POT-Creation-Date: 2017-09-25 20:14:10+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -25,7 +25,7 @@ msgstr "" "X-Poedit-Bookmarks: \n" "X-Textdomain-Support: yes\n" -#: includes/class-cli.php:49 +#: includes/class-command.php:49 #. translators: 1: Human time difference, 2. Timestamp in UTC msgid "Command scheduled for %1$s from now (%2$s)" msgstr "" diff --git a/readme.txt b/readme.txt index 777466962427762ea3f61cc1735fab68959e8b94..c14b160d2b5a06b9303930294128527eeedb8f95 100644 --- a/readme.txt +++ b/readme.txt @@ -25,7 +25,7 @@ Provides a WP-CLI command to schedule these events. A UI is under consideration. = Where is command output captured? = -`error_log()` is used to store WP-CLI's output (`STDOUT`, `STDERR`, and the exit code), along with basic timing information and the command that was executed. +The actions `wp_cli_cron_control_offload_run_success` and `wp_cli_cron_control_offload_run_error` are fired, allowing you to capture command output as your environment allows. = Can this be used with commands that manipulate files? = @@ -51,8 +51,10 @@ Regardless of whether the constant or filter is used, either should provide an a ``` array( - 'post', - 'site', + 'cli', + 'core', + 'eval', + 'eval-file', ) ``` @@ -64,10 +66,8 @@ Regardless of whether the constant or filter is used, either should provide an a ``` array( - 'cli', - 'core', - 'eval', - 'eval-file', + 'post', + 'site', ) ``` diff --git a/wp-cli-cron-control-offload.php b/wp-cli-cron-control-offload.php index 929cd04a04326db5448bbdef565f7d22773d6f61..df9dafae59c9df649cb563fe09e97df9088b5a22 100644 --- a/wp-cli-cron-control-offload.php +++ b/wp-cli-cron-control-offload.php @@ -19,5 +19,5 @@ const CLI_NAMESPACE = 'cli-cron-offload'; const MESSAGE_PREFIX = 'WP-CLI via Cron'; require_once __DIR__ . '/includes/functions.php'; -require_once __DIR__ . '/includes/class-cli.php'; +require_once __DIR__ . '/includes/class-command.php'; require_once __DIR__ . '/includes/run.php';