WC_WCCOM_Site_Installation_Manager
in package
WC_WCCOM_Site_Installation_Manager class
Table of Contents
- STEPS = array('get_product_info', 'download_product', 'unpack_product', 'move_product', 'activate_product')
- $idempotency_key : string
- The idempotency key.
- $product_id : int
- The product ID.
- __construct() : mixed
- Constructor.
- reset_installation() : bool
- Get the next step to run.
- run_installation() : bool
- Run the installation.
- can_run_installation() : void
- Check if the installation can be run.
- get_installation_steps() : array<string|int, string>
- Get the steps to run.
- get_next_step() : string
- Get the next step to run.
- run_step() : void
- Run the step.
Constants
STEPS
public
mixed
STEPS
= array('get_product_info', 'download_product', 'unpack_product', 'move_product', 'activate_product')
Properties
$idempotency_key
The idempotency key.
protected
string
$idempotency_key
$product_id
The product ID.
protected
int
$product_id
Methods
__construct()
Constructor.
public
__construct(int $product_id, string $idempotency_key) : mixed
Parameters
- $product_id : int
-
The product ID.
- $idempotency_key : string
-
The idempotency key.
Return values
mixed —reset_installation()
Get the next step to run.
public
reset_installation() : bool
Tags
Return values
bool —run_installation()
Run the installation.
public
run_installation(string $run_until_step) : bool
Parameters
- $run_until_step : string
-
The step to run until.
Tags
Return values
bool —can_run_installation()
Check if the installation can be run.
protected
can_run_installation(string $run_until_step, WC_WCCOM_Site_Installation_State $state) : void
Parameters
- $run_until_step : string
-
Run until this step.
- $state : WC_WCCOM_Site_Installation_State
-
Installation state.
Tags
Return values
void —get_installation_steps()
Get the steps to run.
protected
get_installation_steps(string $start_step, string $end_step) : array<string|int, string>
Parameters
- $start_step : string
-
The step to start from.
- $end_step : string
-
The step to end at.
Return values
array<string|int, string> —get_next_step()
Get the next step to run.
protected
get_next_step(WC_WCCOM_Site_Installation_State $state) : string
Parameters
- $state : WC_WCCOM_Site_Installation_State
-
Installation state.
Return values
string —run_step()
Run the step.
protected
run_step(string $step_name, WC_WCCOM_Site_Installation_State $state) : void
Parameters
- $step_name : string
-
Step name.
- $state : WC_WCCOM_Site_Installation_State
-
Installation state.