可在以下位置找到卸载过程的一部分setup/src/Magento/Setup/Model/ModuleUninstaller.php
:
public function uninstallCode(OutputInterface $output, array $modules)
{
$output->writeln('<info>Removing code from Magento codebase:</info>');
$packages = [];
/** @var \Magento\Framework\Module\PackageInfo $packageInfo */
$packageInfo = $this->objectManager->get('Magento\Framework\Module\PackageInfoFactory')->create();
foreach ($modules as $module) {
$packages[] = $packageInfo->getPackageName($module);
}
$this->remove->remove($packages);
}
基本上,它列出了要删除的软件包,然后composer remove
通过lib/internal/Magento/Framework/Composer/Remove.php
以下命令在这些软件包上运行命令:
public function remove(array $packages)
{
$composerApplication = $this->composerApplicationFactory->create();
return $composerApplication->runComposerCommand(
[
'command' => 'remove',
'packages' => $packages
]
);
}
您可以在中找到该runComposerCommand
方法vendor/magento/composer/src/MagentoComposerApplication.php
:
public function runComposerCommand(array $commandParams, $workingDir = null)
{
$this->consoleApplication->resetComposer();
if ($workingDir) {
$commandParams[self::COMPOSER_WORKING_DIR] = $workingDir;
} else {
$commandParams[self::COMPOSER_WORKING_DIR] = dirname($this->composerJson);
}
$input = $this->consoleArrayInputFactory->create($commandParams);
$exitCode = $this->consoleApplication->run($input, $this->consoleOutput);
if ($exitCode) {
throw new \RuntimeException(
sprintf('Command "%s" failed: %s', $commandParams['command'], $this->consoleOutput->fetch())
);
}
return $this->consoleOutput->fetch();
}
对我来说,这里发生了一些事情,这些功能是您应该开始调试的地方。
也许您的模块composer.json
文件丢失或有错误。