crawler.cls.php
2 months ago
database.cls.php
2 months ago
debug.cls.php
2 months ago
image.cls.php
2 months ago
online.cls.php
2 months ago
option.cls.php
2 months ago
presets.cls.php
2 months ago
purge.cls.php
2 months ago
debug.cls.php
52 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Debug API CLI for LiteSpeed integration. |
| 4 | * |
| 5 | * @package LiteSpeed\CLI |
| 6 | */ |
| 7 | |
| 8 | namespace LiteSpeed\CLI; |
| 9 | |
| 10 | defined( 'WPINC' ) || exit(); |
| 11 | |
| 12 | use LiteSpeed\Debug2; |
| 13 | use LiteSpeed\Report; |
| 14 | use WP_CLI; |
| 15 | |
| 16 | /** |
| 17 | * Debug API CLI |
| 18 | */ |
| 19 | class Debug { |
| 20 | |
| 21 | /** |
| 22 | * Report instance. |
| 23 | * |
| 24 | * @var Report |
| 25 | */ |
| 26 | private $report; |
| 27 | |
| 28 | /** |
| 29 | * Constructor for Debug CLI. |
| 30 | */ |
| 31 | public function __construct() { |
| 32 | Debug2::debug( 'CLI_Debug init' ); |
| 33 | |
| 34 | $this->report = Report::cls(); |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * Send report |
| 39 | * |
| 40 | * ## OPTIONS |
| 41 | * |
| 42 | * ## EXAMPLES |
| 43 | * |
| 44 | * # Send env report to LiteSpeed |
| 45 | * $ wp litespeed-debug send |
| 46 | */ |
| 47 | public function send() { |
| 48 | $num = $this->report->post_env(); |
| 49 | WP_CLI::success( 'Report Number = ' . $num ); |
| 50 | } |
| 51 | } |
| 52 |