23 private $composerJsonFinder;
28 private $directoryList;
33 private $requireUpdateDryRunCommand;
43 private $magentoComposerApplication;
59 $this->composerJsonFinder = $composerJsonFinder;
60 $this->directoryList = $directoryList;
63 $this->magentoComposerApplication = $composerAppFactory->
create();
75 $composerJson = $this->composerJsonFinder->findComposerJson();
76 $this->file->copy($composerJson, $this->directoryList->getPath(
DirectoryList::VAR_DIR) .
'/composer.json');
79 foreach ($packages as $package) {
80 if (strpos($package,
'magento/product-enterprise-edition') !==
false) {
81 $this->magentoComposerApplication->runComposerCommand(
83 'command' =>
'remove',
84 'packages' => [
'magento/product-community-edition'],
91 $this->requireUpdateDryRunCommand->run($packages, $workingDir);
92 return [
'success' =>
true];
94 $message = str_replace(PHP_EOL,
'<br/>', htmlspecialchars($e->getMessage()));
95 return [
'success' =>
false,
'error' =>
$message];
createRequireUpdateDryRunCommand()
runReadinessCheck(array $packages)
__construct(ComposerJsonFinder $composerJsonFinder, DirectoryList $directoryList, File $file, MagentoComposerApplicationFactory $composerAppFactory)