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