Cli.php in Hostinger Tools 2.1.9, at includes/Cli.php
| 1 | <?php |
| 2 | |
| 3 | namespace Hostinger; |
| 4 | |
| 5 | use WP_CLI; |
| 6 | |
| 7 | defined( 'ABSPATH' ) || exit; |
| 8 | |
| 9 | class Cli { |
| 10 | /** |
| 11 | * Load required files and hooks to make the CLI work. |
| 12 | */ |
| 13 | public function __construct() { |
| 14 | $this->hooks(); |
| 15 | } |
| 16 | |
| 17 | /** |
| 18 | * Sets up and hooks WP CLI to our CLI code. |
| 19 | */ |
| 20 | private function hooks(): void { |
| 21 | if ( class_exists( '\WP_CLI' ) ) { |
| 22 | WP_CLI::add_hook( 'after_wp_load', array( 'Hostinger\Cli\Commands\Maintenance', 'define_command' ) ); |
| 23 | } |
| 24 | } |
| 25 | } |
| 26 |