| 1 |
<?php |
| 2 |
|
| 3 |
defined( 'ABSPATH' ) || exit; |
| 4 |
|
| 5 |
class Hostinger_CLI { |
| 6 |
/** |
| 7 |
* Load required files and hooks to make the CLI work. |
| 8 |
*/ |
| 9 |
public function __construct() { |
| 10 |
$this->includes(); |
| 11 |
$this->hooks(); |
| 12 |
} |
| 13 |
|
| 14 |
public function includes(): void { |
| 15 |
require_once HOSTINGER_ABSPATH . 'includes/cli/class-hostinger-maintenance-command.php'; |
| 16 |
} |
| 17 |
|
| 18 |
/** |
| 19 |
* Sets up and hooks WP CLI to our CLI code. |
| 20 |
*/ |
| 21 |
private function hooks(): void { |
| 22 |
WP_CLI::add_hook( 'after_wp_load', 'Hostinger_Maintenance_Command::define_command' ); |
| 23 |
} |
| 24 |
} |
| 25 |
|
| 26 |
new Hostinger_CLI(); |
| 27 |
|