WC_WCCOM_Site_Installation_State
in package
WC_WCCOM_Site_Installation_State class
Table of Contents
- STEP_STATUS_COMPLETED = 'completed'
- STEP_STATUS_FAILED = 'failed'
- STEP_STATUS_IN_PROGRESS = 'in-progress'
- $already_installed_plugin_info : array<string|int, mixed>
- The plugin info for the already installed plugin.
- $download_path : string
- The path to the downloaded file.
- $download_url : string
- The product slug.
- $idempotency_key : string
- The idempotency key.
- $installed_path : string
- The path to the installed file.
- $last_step_error : string
- The last step error.
- $last_step_name : string
- The last step name.
- $last_step_status : string
- The last step status.
- $product_id : string
- The product ID.
- $product_name : string
- The product name.
- $product_type : string
- The product type.
- $started_date : int
- The timestamp of the installation start.
- $unpacked_path : string
- The path to the unpacked file.
- capture_failure() : mixed
- Capture an installation failure.
- complete_step() : mixed
- Capture a successful installation of a step.
- get_already_installed_plugin_info() : array<string|int, mixed>
- Get the plugin info for the already installed plugin.
- get_download_path() : string
- Get the path to the downloaded file.
- get_download_url() : string
- Get the download URL.
- get_idempotency_key() : string
- Get the idempotency key.
- get_installed_path() : string
- Get the path to the installed file.
- get_last_step_error() : int
- Get the last step error.
- get_last_step_name() : int
- Get the timestamp of the installation start.
- get_last_step_status() : string
- Get the last step status.
- get_product_id() : string
- Get the product ID.
- get_product_name() : string
- Get the product name.
- get_product_type() : string
- Get the product type.
- get_started_date() : int
- Get the timestamp of the installation start.
- get_unpacked_path() : string
- Get the path to the unpacked file.
- initiate_existing() : WC_WCCOM_Site_Installation_State
- Initiate an existing installation state.
- initiate_new() : WC_WCCOM_Site_Installation_State
- Initiate a new installation state.
- initiate_step() : void
- Initiate a step.
- set_already_installed_plugin_info() : mixed
- Set the plugin info for the already installed plugin.
- set_download_path() : mixed
- Set the path to the downloaded file.
- set_download_url() : mixed
- Set the download URL.
- set_installed_path() : mixed
- Set the path to the installed file.
- set_product_name() : mixed
- Set the product name.
- set_product_type() : mixed
- Set the product type.
- set_unpacked_path() : mixed
- Set the path to the unpacked file.
- __construct() : mixed
- Constructor.
Constants
STEP_STATUS_COMPLETED
public
mixed
STEP_STATUS_COMPLETED
= 'completed'
STEP_STATUS_FAILED
public
mixed
STEP_STATUS_FAILED
= 'failed'
STEP_STATUS_IN_PROGRESS
public
mixed
STEP_STATUS_IN_PROGRESS
= 'in-progress'
Properties
$already_installed_plugin_info
The plugin info for the already installed plugin.
protected
array<string|int, mixed>
$already_installed_plugin_info
$download_path
The path to the downloaded file.
protected
string
$download_path
$download_url
The product slug.
protected
string
$download_url
$idempotency_key
The idempotency key.
protected
string
$idempotency_key
$installed_path
The path to the installed file.
protected
string
$installed_path
$last_step_error
The last step error.
protected
string
$last_step_error
$last_step_name
The last step name.
protected
string
$last_step_name
$last_step_status
The last step status.
protected
string
$last_step_status
$product_id
The product ID.
protected
string
$product_id
$product_name
The product name.
protected
string
$product_name
$product_type
The product type.
protected
string
$product_type
$started_date
The timestamp of the installation start.
protected
int
$started_date
$unpacked_path
The path to the unpacked file.
protected
string
$unpacked_path
Methods
capture_failure()
Capture an installation failure.
public
capture_failure(string $step_name, string $error_code) : mixed
Parameters
- $step_name : string
-
The step name.
- $error_code : string
-
The error code.
Return values
mixed —complete_step()
Capture a successful installation of a step.
public
complete_step(string $step_name) : mixed
Parameters
- $step_name : string
-
The step name.
Return values
mixed —get_already_installed_plugin_info()
Get the plugin info for the already installed plugin.
public
get_already_installed_plugin_info() : array<string|int, mixed>
Return values
array<string|int, mixed> —get_download_path()
Get the path to the downloaded file.
public
get_download_path() : string
Return values
string —get_download_url()
Get the download URL.
public
get_download_url() : string
Return values
string —get_idempotency_key()
Get the idempotency key.
public
get_idempotency_key() : string
Return values
string —get_installed_path()
Get the path to the installed file.
public
get_installed_path() : string
Return values
string —get_last_step_error()
Get the last step error.
public
get_last_step_error() : int
Return values
int —get_last_step_name()
Get the timestamp of the installation start.
public
get_last_step_name() : int
Return values
int —get_last_step_status()
Get the last step status.
public
get_last_step_status() : string
Return values
string —get_product_id()
Get the product ID.
public
get_product_id() : string
Return values
string —get_product_name()
Get the product name.
public
get_product_name() : string
Return values
string —get_product_type()
Get the product type.
public
get_product_type() : string
Return values
string —get_started_date()
Get the timestamp of the installation start.
public
get_started_date() : int
Return values
int —get_unpacked_path()
Get the path to the unpacked file.
public
get_unpacked_path() : string
Return values
string —initiate_existing()
Initiate an existing installation state.
public
static initiate_existing(int $product_id, string $idempotency_key, string $last_step_name, string $last_step_status, string $last_step_error, int $started_date) : WC_WCCOM_Site_Installation_State
Parameters
- $product_id : int
-
The product ID.
- $idempotency_key : string
-
The idempotency key.
- $last_step_name : string
-
The last step name.
- $last_step_status : string
-
The last step status.
- $last_step_error : string
-
The last step error.
- $started_date : int
-
The timestamp of the installation start.
Return values
WC_WCCOM_Site_Installation_State — The instance.initiate_new()
Initiate a new installation state.
public
static initiate_new(init $product_id, string $idempotency_key) : WC_WCCOM_Site_Installation_State
Parameters
- $product_id : init
-
The product ID.
- $idempotency_key : string
-
The idempotency key.
Return values
WC_WCCOM_Site_Installation_State — The instance.initiate_step()
Initiate a step.
public
initiate_step(string $step_name) : void
Parameters
- $step_name : string
-
Step name.
Return values
void —set_already_installed_plugin_info()
Set the plugin info for the already installed plugin.
public
set_already_installed_plugin_info(array<string|int, mixed> $plugin_info) : mixed
Parameters
- $plugin_info : array<string|int, mixed>
-
The plugin info.
Return values
mixed —set_download_path()
Set the path to the downloaded file.
public
set_download_path(string $download_path) : mixed
Parameters
- $download_path : string
-
The path to the downloaded file.
Return values
mixed —set_download_url()
Set the download URL.
public
set_download_url(string $download_url) : mixed
Parameters
- $download_url : string
-
The download URL.
Return values
mixed —set_installed_path()
Set the path to the installed file.
public
set_installed_path(string $installed_path) : mixed
Parameters
- $installed_path : string
-
The path to the installed file.
Return values
mixed —set_product_name()
Set the product name.
public
set_product_name(string $product_name) : mixed
Parameters
- $product_name : string
-
The product name.
Return values
mixed —set_product_type()
Set the product type.
public
set_product_type(string $product_type) : mixed
Parameters
- $product_type : string
-
The product type.
Return values
mixed —set_unpacked_path()
Set the path to the unpacked file.
public
set_unpacked_path(string $unpacked_path) : mixed
Parameters
- $unpacked_path : string
-
The path to the unpacked file.
Return values
mixed —__construct()
Constructor.
protected
__construct(string $product_id) : mixed
Parameters
- $product_id : string
-
The product ID.