✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ premium290.web-hosting.com ​🇻​♯➤ 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2025

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 63.250.38.37 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.216.105
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /home/tdhomesa/public_html/wp-content/plugins/woocommerce/packages/blueprint/src//ExportSchema.php
<?php

namespace Automattic\WooCommerce\Blueprint;

use Automattic\WooCommerce\Blueprint\Exporters\StepExporter;
use Automattic\WooCommerce\Blueprint\Exporters\HasAlias;
use Automattic\WooCommerce\Blueprint\Logger;
use Automattic\WooCommerce\Blueprint\Steps\Step;
use WP_Error;

/**
 * Class ExportSchema
 *
 * Handles the export schema functionality for WooCommerce.
 *
 * @package Automattic\WooCommerce\Blueprint
 */
class ExportSchema {
	use UseWPFunctions;
	use UsePubSub;

	/**
	 * Step exporters.
	 *
	 * @var StepExporter[] Array of step exporters.
	 */
	protected array $exporters = array();

	/**
	 * ExportSchema constructor.
	 *
	 * @param StepExporter[] $exporters Array of step exporters.
	 */
	public function __construct( $exporters = array() ) {
		$this->exporters = $exporters;
	}

	/**
	 * Export the schema steps.
	 *
	 * @param string[] $steps Array of step names to export, optional.
	 *
	 * @return array|WP_Error The exported schema array or a WP_Error if the export fails.
	 */
	public function export( $steps = array() ) {
		$loading_page_path = $this->wp_apply_filters( 'wooblueprint_export_landingpage', '/' );
		/**
		 * Validate that the landing page path is a valid relative local URL path.
		 *
		 * Accepts:
		 * - /
		 * - /path/to/page
		 *
		 * Rejects:
		 * - http://example.com/path/to/page
		 * - invalid-path
		 */
		if ( ! preg_match( '#^/$|^/[^/].*#', $loading_page_path ) ) {
			return new WP_Error( 'wooblueprint_invalid_landing_page_path', 'Invalid loading page path.' );
		}

		$schema = array(
			'landingPage' => $loading_page_path,
			'steps'       => array(),
		);

		$built_in_exporters = ( new BuiltInExporters() )->get_all();

		/**
		 * Filters the step exporters.
		 *
		 * Allows adding/removing custom step exporters.
		 *
		 * @param StepExporter[] $exporters Array of step exporters.
		 *
		 * @since 0.0.1
		 */
		$exporters = $this->wp_apply_filters( 'wooblueprint_exporters', array_merge( $this->exporters, $built_in_exporters ) );
		// Validate that the exporters are instances of StepExporter.
		$exporters = array_filter(
			$exporters,
			function ( $exporter ) {
				return $exporter instanceof StepExporter;
			}
		);

		// Filter out any exporters that are not in the list of steps to export.
		if ( count( $steps ) ) {
			foreach ( $exporters as $key => $exporter ) {
				$name  = $exporter->get_step_name();
				$alias = $exporter instanceof HasAlias ? $exporter->get_alias() : $name;
				if ( ! in_array( $name, $steps, true ) && ! in_array( $alias, $steps, true ) ) {
					unset( $exporters[ $key ] );
				}
			}
		}

		// Make sure the user has the required capabilities to export the steps.
		foreach ( $exporters as $exporter ) {
			if ( ! $exporter->check_step_capabilities() ) {
				return new WP_Error( 'wooblueprint_insufficient_permissions', 'Insufficient permissions to export for step: ' . $exporter->get_step_name() );
			}
		}

		$logger = new Logger();
		$logger->start_export( $exporters );

		foreach ( $exporters as $exporter ) {
			try {
				$this->publish( 'onBeforeExport', $exporter );
				$step = $exporter->export();
				$this->add_result_to_schema( $schema, $step );

			} catch ( \Throwable $e ) {
				$step_name = $exporter instanceof HasAlias ? $exporter->get_alias() : $exporter->get_step_name();
				$logger->export_step_failed( $step_name, $e );
				return new WP_Error( 'wooblueprint_export_step_failed', 'Export step failed: ' . $e->getMessage() );
			}
		}

		$logger->complete_export( $exporters );

		return $schema;
	}

	/**
	 * Subscribe to the onBeforeExport event.
	 *
	 * @param string   $step_name The step name to subscribe to.
	 * @param callable $callback  The callback to execute.
	 */
	public function on_before_export( $step_name, $callback ) {
		$this->subscribe(
			'onBeforeExport',
			function ( $exporter ) use ( $step_name, $callback ) {
				if ( $step_name === $exporter->get_step_name() ) {
					$callback( $exporter );
				}
			}
		);
	}

	/**
	 * Add export result to the schema array.
	 *
	 * @param array      $schema Schema array to add steps to.
	 * @param array|Step $step   Step or array of steps to add.
	 */
	private function add_result_to_schema( array &$schema, $step ): void {
		if ( is_array( $step ) ) {
			foreach ( $step as $_step ) {
				$schema['steps'][] = $_step->get_json_array();
			}
			return;
		}

		$schema['steps'][] = $step->get_json_array();
	}
}


Current_dir [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
Cli
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
Exporters
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
Importers
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
ResourceStorages
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
ResultFormatters
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
Schemas
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
Steps
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
docs
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
BuiltInExporters.php
0.463 KB
12 May 2025 9.07 PM
tdhomesa / tdhomesa
0644
BuiltInStepProcessors.php
1.809 KB
12 May 2025 9.07 PM
tdhomesa / tdhomesa
0644
ClassExtractor.php
6.055 KB
12 May 2025 9.07 PM
tdhomesa / tdhomesa
0644
Cli.php
1.78 KB
12 May 2025 9.07 PM
tdhomesa / tdhomesa
0644
ExportSchema.php
4.301 KB
12 May 2025 9.07 PM
tdhomesa / tdhomesa
0644
ImportSchema.php
2.337 KB
12 May 2025 9.07 PM
tdhomesa / tdhomesa
0644
ImportStep.php
4.465 KB
12 May 2025 9.07 PM
tdhomesa / tdhomesa
0644
Logger.php
4.066 KB
12 May 2025 9.07 PM
tdhomesa / tdhomesa
0644
ResourceStorages.php
1.452 KB
12 May 2025 9.07 PM
tdhomesa / tdhomesa
0644
StepProcessor.php
0.664 KB
12 May 2025 9.07 PM
tdhomesa / tdhomesa
0644
StepProcessorResult.php
3.563 KB
12 May 2025 9.07 PM
tdhomesa / tdhomesa
0644
UsePluginHelpers.php
3.127 KB
12 May 2025 9.07 PM
tdhomesa / tdhomesa
0644
UsePubSub.php
1.509 KB
12 May 2025 9.07 PM
tdhomesa / tdhomesa
0644
UseWPFunctions.php
9.717 KB
12 May 2025 9.07 PM
tdhomesa / tdhomesa
0644
Util.php
4.386 KB
12 May 2025 9.07 PM
tdhomesa / tdhomesa
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF