42 private $composerInformation;
47 private $moduleUninstall;
52 private $themeUninstall;
75 Helper\ModuleUninstall $moduleUninstall,
76 Helper\ThemeUninstall $themeUninstall,
78 \Symfony\Component\Console\Output\OutputInterface
$output,
85 $this->composerInformation = $composerInformation;
86 $this->moduleUninstall = $moduleUninstall;
87 $this->themeUninstall = $themeUninstall;
88 $this->objectManager = $objectManagerProvider->get();
89 $this->updater = $updater;
102 if (!isset($this->params[
'components']) || !is_array($this->params[
'components'])) {
103 $this->status->toggleUpdateError(
true);
104 throw new \RuntimeException(
'Job parameter format is incorrect');
106 $components = $this->params[
'components'];
107 foreach ($components as $component) {
108 $this->executeComponent($component);
110 $this->queue->addJobs(
115 $this->status->toggleUpdateError(
true);
116 throw new \RuntimeException($errorMessage);
127 private function executeComponent(array $component)
129 if (!isset($component[self::COMPONENT_NAME])) {
130 $this->status->toggleUpdateError(
true);
131 throw new \RuntimeException(
'Job parameter format is incorrect');
135 $installedPackages = $this->composerInformation->getInstalledMagentoPackages();
136 if (isset($installedPackages[$componentName][
'type'])) {
137 $type = $installedPackages[$componentName][
'type'];
139 $this->status->toggleUpdateError(
true);
140 throw new \RuntimeException(
'Component type not set');
143 if (!in_array(
$type, [
149 $this->status->toggleUpdateError(
true);
150 throw new \RuntimeException(
'Unknown component type');
155 $dataOption = isset($this->params[self::DATA_OPTION]) && $this->params[
self::DATA_OPTION] ===
'true';
156 $this->moduleUninstall->uninstall(
163 $this->themeUninstall->uninstall($this->
output, $componentName);
__construct(\Magento\Framework\Composer\ComposerInformation $composerInformation, Helper\ModuleUninstall $moduleUninstall, Helper\ThemeUninstall $themeUninstall, \Magento\Setup\Model\ObjectManagerProvider $objectManagerProvider, \Symfony\Component\Console\Output\OutputInterface $output, \Magento\Setup\Model\Cron\Queue $queue, \Magento\Setup\Model\Cron\Status $status, \Magento\Setup\Model\Updater $updater, $name, $params=[])
output($string, $level=INFO, $label='')
const TASK_TYPE_UNINSTALL
const JOB_STATIC_REGENERATE