Cli
1 year ago
Exporters
1 year ago
Importers
1 year ago
ResourceStorages
1 year ago
ResultFormatters
1 year ago
Schemas
1 year ago
Steps
1 year ago
docs
1 year ago
BuiltInExporters.php
1 year ago
BuiltInStepProcessors.php
1 year ago
ClassExtractor.php
1 year ago
Cli.php
1 year ago
ExportSchema.php
1 year ago
ImportSchema.php
1 year ago
ImportStep.php
1 year ago
Logger.php
1 year ago
ResourceStorages.php
1 year ago
StepProcessor.php
1 year ago
StepProcessorResult.php
1 year ago
UsePluginHelpers.php
1 year ago
UsePubSub.php
1 year ago
UseWPFunctions.php
1 year ago
Util.php
1 year ago
BuiltInStepProcessors.php
64 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Automattic\WooCommerce\Blueprint; |
| 4 | |
| 5 | use Automattic\WooCommerce\Blueprint\Importers\ImportActivatePlugin; |
| 6 | use Automattic\WooCommerce\Blueprint\Importers\ImportActivateTheme; |
| 7 | use Automattic\WooCommerce\Blueprint\Importers\ImportInstallPlugin; |
| 8 | use Automattic\WooCommerce\Blueprint\Importers\ImportInstallTheme; |
| 9 | use Automattic\WooCommerce\Blueprint\Importers\ImportRunSql; |
| 10 | use Automattic\WooCommerce\Blueprint\Importers\ImportSetSiteOptions; |
| 11 | use Automattic\WooCommerce\Blueprint\ResourceStorages\OrgPluginResourceStorage; |
| 12 | use Automattic\WooCommerce\Blueprint\ResourceStorages\OrgThemeResourceStorage; |
| 13 | |
| 14 | /** |
| 15 | * Class BuiltInStepProcessors |
| 16 | * |
| 17 | * @package Automattic\WooCommerce\Blueprint |
| 18 | */ |
| 19 | class BuiltInStepProcessors { |
| 20 | /** |
| 21 | * BuiltInStepProcessors constructor. |
| 22 | */ |
| 23 | public function __construct() { |
| 24 | } |
| 25 | |
| 26 | /** |
| 27 | * Returns an array of all step processors. |
| 28 | * |
| 29 | * @return array The array of step processors. |
| 30 | */ |
| 31 | public function get_all() { |
| 32 | return array( |
| 33 | $this->create_install_plugins_processor(), |
| 34 | $this->create_install_themes_processor(), |
| 35 | new ImportSetSiteOptions(), |
| 36 | new ImportActivatePlugin(), |
| 37 | new ImportActivateTheme(), |
| 38 | new ImportRunSql(), |
| 39 | ); |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * Creates the processor for installing plugins. |
| 44 | * |
| 45 | * @return ImportInstallPlugin The processor for installing plugins. |
| 46 | */ |
| 47 | private function create_install_plugins_processor() { |
| 48 | $storages = new ResourceStorages(); |
| 49 | $storages->add_storage( new OrgPluginResourceStorage() ); |
| 50 | return new ImportInstallPlugin( $storages ); |
| 51 | } |
| 52 | |
| 53 | /** |
| 54 | * Creates the processor for installing themes. |
| 55 | * |
| 56 | * @return ImportInstallTheme The processor for installing themes. |
| 57 | */ |
| 58 | private function create_install_themes_processor() { |
| 59 | $storage = new ResourceStorages(); |
| 60 | $storage->add_storage( new OrgThemeResourceStorage() ); |
| 61 | return new ImportInstallTheme( $storage ); |
| 62 | } |
| 63 | } |
| 64 |