6
6
namespace Magento \Setup \Console \Command ;
7
7
8
8
use Symfony \Component \Console \Input \InputInterface ;
9
- use Symfony \Component \Console \Input \InputOption ;
10
9
use Symfony \Component \Console \Output \OutputInterface ;
10
+ use Symfony \Component \Console \Input \InputOption ;
11
+ use Magento \Framework \App \DeploymentConfig ;
11
12
12
13
abstract class AbstractModuleManageCommand extends AbstractModuleCommand
13
14
{
@@ -17,6 +18,11 @@ abstract class AbstractModuleManageCommand extends AbstractModuleCommand
17
18
const INPUT_KEY_ALL = 'all ' ;
18
19
const INPUT_KEY_FORCE = 'force ' ;
19
20
21
+ /**
22
+ * @var DeploymentConfig
23
+ */
24
+ private $ deploymentConfig ;
25
+
20
26
/**
21
27
* {@inheritdoc}
22
28
*/
@@ -91,10 +97,12 @@ protected function execute(InputInterface $input, OutputInterface $output)
91
97
$ output ->writeln ('<info>The following modules have been enabled:</info> ' );
92
98
$ output ->writeln ('<info>- ' . implode ("\n- " , $ modulesToChange ) . '</info> ' );
93
99
$ 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
+ }
98
106
} else {
99
107
$ output ->writeln ('<info>The following modules have been disabled:</info> ' );
100
108
$ output ->writeln ('<info>- ' . implode ("\n- " , $ modulesToChange ) . '</info> ' );
@@ -134,4 +142,18 @@ protected function validate(array $modules)
134
142
* @return bool
135
143
*/
136
144
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
+ }
137
159
}
0 commit comments