|
9 | 9 | use Magento\Framework\App\State as AppState;
|
10 | 10 | use Magento\Framework\App\DeploymentConfig;
|
11 | 11 | use Magento\Framework\App\ObjectManager;
|
| 12 | +use Magento\Framework\Config\CacheInterface; |
12 | 13 | use Magento\Framework\Setup\ConsoleLogger;
|
13 | 14 | use Magento\Framework\Setup\Declaration\Schema\DryRunLogger;
|
14 | 15 | use Magento\Framework\Setup\Declaration\Schema\OperationsExecutor;
|
@@ -52,22 +53,30 @@ class UpgradeCommand extends AbstractSetupCommand
|
52 | 53 | */
|
53 | 54 | private $searchConfigFactory;
|
54 | 55 |
|
| 56 | + /* |
| 57 | + * @var CacheInterface |
| 58 | + */ |
| 59 | + private $cache; |
| 60 | + |
55 | 61 | /**
|
56 | 62 | * @param InstallerFactory $installerFactory
|
57 | 63 | * @param SearchConfigFactory $searchConfigFactory
|
58 | 64 | * @param DeploymentConfig $deploymentConfig
|
59 | 65 | * @param AppState|null $appState
|
| 66 | + * @param CacheInterface|null $cache |
60 | 67 | */
|
61 | 68 | public function __construct(
|
62 | 69 | InstallerFactory $installerFactory,
|
63 | 70 | SearchConfigFactory $searchConfigFactory,
|
64 | 71 | DeploymentConfig $deploymentConfig = null,
|
65 |
| - AppState $appState = null |
| 72 | + AppState $appState = null, |
| 73 | + CacheInterface $cache = null |
66 | 74 | ) {
|
67 | 75 | $this->installerFactory = $installerFactory;
|
68 | 76 | $this->searchConfigFactory = $searchConfigFactory;
|
69 | 77 | $this->deploymentConfig = $deploymentConfig ?: ObjectManager::getInstance()->get(DeploymentConfig::class);
|
70 | 78 | $this->appState = $appState ?: ObjectManager::getInstance()->get(AppState::class);
|
| 79 | + $this->cache = $cache ?: ObjectManager::getInstance()->get(CacheInterface::class); |
71 | 80 | parent::__construct();
|
72 | 81 | }
|
73 | 82 |
|
@@ -129,6 +138,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
|
129 | 138 | $installer = $this->installerFactory->create(new ConsoleLogger($output));
|
130 | 139 | $installer->updateModulesSequence($keepGenerated);
|
131 | 140 | $searchConfig = $this->searchConfigFactory->create();
|
| 141 | + $this->cache->clean(); |
132 | 142 | $searchConfig->validateSearchEngine();
|
133 | 143 | $installer->installSchema($request);
|
134 | 144 | $installer->installDataFixtures($request);
|
|
0 commit comments