PUM_Abstract_Upgrade

Implements a basic upgrade process.


Description Description

Handles marking complete and resume management.


Source Source

File: classes/Abstract/Upgrade.php

abstract class PUM_Abstract_Upgrade extends PUM_Abstract_Batch_Process {

	/**
	 * Store the current upgrade args in case we need to redo somehting
	 *
	 * @param int $step
	 */
	public function __construct( $step = 1 ) {
		update_option( 'pum_doing_upgrade', array(
			'upgrade_id' => $this->batch_id,
			'step'       => $step,
		) );

		parent::__construct( $step );
	}


	/**
	 * Defines logic to execute once batch processing is complete.
	 */
	public function finish() {
		/**
		 * Clear the doing upgrade flag to prevent issues later.
		 */
		delete_option( 'pum_doing_upgrade' );

		parent::finish();
	}


}

Top ↑

Changelog Changelog

Changelog
Version Description
1.7.0 Introduced.


Top ↑

Methods Methods

  • __construct — Store the current upgrade args in case we need to redo somehting
  • finish — Defines logic to execute once batch processing is complete.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.