37 lines
620 B
PHP
37 lines
620 B
PHP
<?php
|
|
|
|
/**
|
|
* Enables running wiaas with wp cli commands
|
|
*/
|
|
|
|
defined( 'ABSPATH' ) || exit;
|
|
|
|
/**
|
|
* CLI class.
|
|
*/
|
|
class Wiaas_CLI {
|
|
/**
|
|
* Load required files and hooks to make the CLI work.
|
|
*/
|
|
public function __construct() {
|
|
$this->includes();
|
|
$this->hooks();
|
|
}
|
|
|
|
/**
|
|
* Load command files.
|
|
*/
|
|
private function includes() {
|
|
require_once dirname( __FILE__ ) . '/cli/class-wiaas-update-db-command.php';
|
|
}
|
|
|
|
/**
|
|
* Sets up and hooks WP CLI to our CLI code.
|
|
*/
|
|
private function hooks() {
|
|
WP_CLI::add_hook( 'after_wp_load', 'Wiaas_CLI_Update_DB_Command::register_commands' );
|
|
}
|
|
}
|
|
|
|
new Wiaas_CLI();
|