| 1 |
<?php |
| 2 |
/** |
| 3 |
* CLI commands for StoreEngine |
| 4 |
* @version 1.0.0 |
| 5 |
* @since 1.8.2 |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace StoreEngine; |
| 9 |
|
| 10 |
use StoreEngine\Cli\License; |
| 11 |
use StoreEngine\Cli\Order; |
| 12 |
use StoreEngine\Traits\Singleton; |
| 13 |
use StoreEngine\Utils\Helper; |
| 14 |
use WP_CLI; |
| 15 |
|
| 16 |
if ( ! defined( 'ABSPATH' ) ) { |
| 17 |
exit; |
| 18 |
} |
| 19 |
|
| 20 |
class Cli { |
| 21 |
use Singleton; |
| 22 |
|
| 23 |
protected function __construct() { |
| 24 |
add_action( 'cli_init', [ __CLASS__, 'register_cli_commands' ] ); |
| 25 |
} |
| 26 |
|
| 27 |
public static function register_cli_commands() { |
| 28 |
WP_CLI::add_command( 'storeengine order', Order::class ); |
| 29 |
|
| 30 |
if ( Helper::get_addon_active_status( 'license-management', true ) ) { |
| 31 |
WP_CLI::add_command( 'storeengine license', License::class ); |
| 32 |
} |
| 33 |
} |
| 34 |
} |
| 35 |
|
| 36 |
// End of the file cli.php |
| 37 |
|