WC_WCCOM_Site_Installation_Manager::run_step()protectedWC 1.0

Run the step.

Method of the class: WC_WCCOM_Site_Installation_Manager{}

No Hooks.

Return

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->run_step( $step_name, $state );
$step_name(string) (required)
Step name.
$state(WC_WCCOM_Site_Installation_State) (required)
Installation state.

WC_WCCOM_Site_Installation_Manager::run_step() code WC 9.4.2

protected function run_step( $step_name, $state ) {
	$state->initiate_step( $step_name );
	WC_WCCOM_Site_Installation_State_Storage::save_state( $state );

	try {
		$class_name   = "WC_WCCOM_Site_Installation_Step_$step_name";
		$current_step = new $class_name( $state );
		$current_step->run();
	} catch ( Installer_Error $exception ) {
		$state->capture_failure( $step_name, $exception->get_error_code() );
		WC_WCCOM_Site_Installation_State_Storage::save_state( $state );

		throw $exception;
	} catch ( Throwable $error ) {
		$state->capture_failure( $step_name, Installer_Error_Codes::UNEXPECTED_ERROR );
		WC_WCCOM_Site_Installation_State_Storage::save_state( $state );

		throw new Installer_Error( Installer_Error_Codes::UNEXPECTED_ERROR, $error->getMessage() );
	}

	$state->complete_step( $step_name );
	WC_WCCOM_Site_Installation_State_Storage::save_state( $state );
}