Skip to content

Commit eb366c2

Browse files
Igor Melnikovvrann
authored andcommitted
MAGETWO-51592: Make single tenant compiler work when Magento not installed
Do not suggest to run setup:upgrade if Magento is not installed
1 parent c66de3e commit eb366c2

File tree

1 file changed

+27
-5
lines changed

1 file changed

+27
-5
lines changed

setup/src/Magento/Setup/Console/Command/AbstractModuleManageCommand.php

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
namespace Magento\Setup\Console\Command;
77

88
use Symfony\Component\Console\Input\InputInterface;
9-
use Symfony\Component\Console\Input\InputOption;
109
use Symfony\Component\Console\Output\OutputInterface;
10+
use Symfony\Component\Console\Input\InputOption;
11+
use Magento\Framework\App\DeploymentConfig;
1112

1213
abstract class AbstractModuleManageCommand extends AbstractModuleCommand
1314
{
@@ -17,6 +18,11 @@ abstract class AbstractModuleManageCommand extends AbstractModuleCommand
1718
const INPUT_KEY_ALL = 'all';
1819
const INPUT_KEY_FORCE = 'force';
1920

21+
/**
22+
* @var DeploymentConfig
23+
*/
24+
private $deploymentConfig;
25+
2026
/**
2127
* {@inheritdoc}
2228
*/
@@ -91,10 +97,12 @@ protected function execute(InputInterface $input, OutputInterface $output)
9197
$output->writeln('<info>The following modules have been enabled:</info>');
9298
$output->writeln('<info>- ' . implode("\n- ", $modulesToChange) . '</info>');
9399
$output->writeln('');
94-
$output->writeln(
95-
'<info>To make sure that the enabled modules are properly registered,'
96-
. " run 'setup:upgrade'.</info>"
97-
);
100+
if ($this->getDeploymentConfig()->isAvailable()) {
101+
$output->writeln(
102+
'<info>To make sure that the enabled modules are properly registered,'
103+
. " run 'setup:upgrade'.</info>"
104+
);
105+
}
98106
} else {
99107
$output->writeln('<info>The following modules have been disabled:</info>');
100108
$output->writeln('<info>- ' . implode("\n- ", $modulesToChange) . '</info>');
@@ -134,4 +142,18 @@ protected function validate(array $modules)
134142
* @return bool
135143
*/
136144
abstract protected function isEnable();
145+
146+
/**
147+
* Get deployment config
148+
*
149+
* @return DeploymentConfig
150+
* @deprecated
151+
*/
152+
private function getDeploymentConfig()
153+
{
154+
if (!($this->deploymentConfig instanceof DeploymentConfig)) {
155+
return $this->objectManager->get(DeploymentConfig::class);
156+
}
157+
return $this->deploymentConfig;
158+
}
137159
}

0 commit comments

Comments
 (0)