Cli.php in SpinupWP 1.4, at src/Cli.php
| 1 | <?php |
| 2 | |
| 3 | namespace DeliciousBrains\SpinupWp; |
| 4 | |
| 5 | use WP_CLI; |
| 6 | |
| 7 | class Cli { |
| 8 | |
| 9 | /** |
| 10 | * Register a CLI command. |
| 11 | * |
| 12 | * @param string $command |
| 13 | * @param string $callable |
| 14 | * |
| 15 | * @return bool |
| 16 | */ |
| 17 | public function register_command( $command, $callable ) { |
| 18 | if ( ! defined( 'WP_CLI' ) || ! WP_CLI ) { |
| 19 | return false; |
| 20 | } |
| 21 | |
| 22 | return WP_CLI::add_command( $command, $callable ); |
| 23 | } |
| 24 | } |