403Webshell
Server IP : 172.67.158.161  /  Your IP : 3.17.110.113
Web Server : LiteSpeed
System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : giankuin ( 1871)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/giankuin/thietke365.net/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/giankuin/thietke365.net/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src//Migration.php
<?php
namespace Automattic\WooCommerce\Blocks;

/**
 * Takes care of the migrations.
 *
 * @since 2.5.0
 */
class Migration {
	/**
	 * DB updates and callbacks that need to be run per version.
	 *
	 * Please note that these functions are invoked when WooCommerce Blocks is updated from a previous version,
	 * but NOT when WooCommerce Blocks is newly installed.
	 *
	 * @var array
	 */
	private $db_upgrades = array(
		'10.3.0' => array(
			'wc_blocks_update_1030_blockified_product_grid_block',
		),
	);

	/**
	 * Runs all the necessary migrations.
	 *
	 * @var array
	 */
	public function run_migrations() {
		$current_db_version = get_option( Options::WC_BLOCK_VERSION, '' );
		$schema_version     = get_option( 'wc_blocks_db_schema_version', '' );

		// This check is necessary because the version was not being set in the database until 10.3.0.
		// Checking wc_blocks_db_schema_version determines if it's a fresh install (value will be empty)
		// or an update from WC Blocks older than 10.3.0 (it will have some value). In the latter scenario
		// we should run the migration.
		// We can remove this check in the next months.
		if ( ! empty( $schema_version ) && ( empty( $current_db_version ) ) ) {
			$this->wc_blocks_update_1030_blockified_product_grid_block();
		}

		if ( empty( $current_db_version ) ) {
			// This is a fresh install, so we don't need to run any migrations.
			return;
		}

		foreach ( $this->db_upgrades as $version => $update_callbacks ) {
			if ( version_compare( $current_db_version, $version, '<' ) ) {
				foreach ( $update_callbacks as $update_callback ) {
					$this->{$update_callback}();
				}
			}
		}
	}

	/**
	 * Set a flag to indicate if the blockified Product Grid Block should be rendered by default.
	 */
	public static function wc_blocks_update_1030_blockified_product_grid_block() {
		update_option( Options::WC_BLOCK_USE_BLOCKIFIED_PRODUCT_GRID_BLOCK_AS_TEMPLATE, wc_bool_to_string( false ) );
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit