WC_WCCOM_Site_Installation_Manager::run_installation()publicWC 1.0

Run the installation.

Method of the class: WC_WCCOM_Site_Installation_Manager{}

No Hooks.

Return

true|false.

Usage

$WC_WCCOM_Site_Installation_Manager = new WC_WCCOM_Site_Installation_Manager();
$WC_WCCOM_Site_Installation_Manager->run_installation( $run_until_step ): bool;
$run_until_step(string) (required)
The step to run until.

WC_WCCOM_Site_Installation_Manager::run_installation() code WC 9.4.2

public function run_installation( string $run_until_step ): bool {
	$state = WC_WCCOM_Site_Installation_State_Storage::get_state( $this->product_id );

	if ( $state && $state->get_idempotency_key() !== $this->idempotency_key ) {
		throw new Installer_Error( Installer_Error_Codes::IDEMPOTENCY_KEY_MISMATCH );
	}

	if ( ! $state ) {
		$state = WC_WCCOM_Site_Installation_State::initiate_new( $this->product_id, $this->idempotency_key );
	}

	$this->can_run_installation( $run_until_step, $state );

	$next_step          = $this->get_next_step( $state );
	$installation_steps = $this->get_installation_steps( $next_step, $run_until_step );

	array_walk(
		$installation_steps,
		function ( $step_name ) use ( $state ) {
			$this->run_step( $step_name, $state );
		}
	);

	return true;
}