6
6
namespace Magento \Config \Console \Command ;
7
7
8
8
use Magento \Config \App \Config \Type \System ;
9
- use Magento \Config \Console \Command \ConfigSet \EmulatedProcessorFacade ;
9
+ use Magento \Config \Console \Command \ConfigSet \ProcessorFacadeFactory ;
10
10
use Magento \Deploy \Model \DeploymentConfig \ChangeDetector ;
11
11
use Magento \Deploy \Model \DeploymentConfig \Hash ;
12
- use Magento \Deploy \Model \DeploymentConfig \Validator ;
13
12
use Magento \Framework \App \Config \ScopeConfigInterface ;
14
13
use Magento \Framework \Console \Cli ;
15
14
use Symfony \Component \Console \Command \Command ;
@@ -34,11 +33,11 @@ class ConfigSetCommand extends Command
34
33
/**#@-*/
35
34
36
35
/**
37
- * The emulated processor facade .
36
+ * Emulator adminhtml area for CLI command .
38
37
*
39
- * @var EmulatedProcessorFacade
38
+ * @var EmulatedAdminhtmlAreaProcessor
40
39
*/
41
- private $ emulatedProcessorFacade ;
40
+ private $ emulatedAreaProcessor ;
42
41
43
42
/**
44
43
* The config change detector.
@@ -55,18 +54,28 @@ class ConfigSetCommand extends Command
55
54
private $ hash ;
56
55
57
56
/**
58
- * @param EmulatedProcessorFacade $emulatedProcessorFacade The emulated processor facade
57
+ * The factory for processor facade.
58
+ *
59
+ * @var ProcessorFacadeFactory
60
+ */
61
+ private $ processorFacadeFactory ;
62
+
63
+ /**
64
+ * @param EmulatedAdminhtmlAreaProcessor $emulatedAreaProcessor Emulator adminhtml area for CLI command
59
65
* @param ChangeDetector $changeDetector The config change detector
60
66
* @param Hash $hash The hash manager
67
+ * @param ProcessorFacadeFactory $processorFacadeFactory The factory for processor facade
61
68
*/
62
69
public function __construct (
63
- EmulatedProcessorFacade $ emulatedProcessorFacade ,
70
+ EmulatedAdminhtmlAreaProcessor $ emulatedAreaProcessor ,
64
71
ChangeDetector $ changeDetector ,
65
- Hash $ hash
72
+ Hash $ hash ,
73
+ ProcessorFacadeFactory $ processorFacadeFactory
66
74
) {
67
- $ this ->emulatedProcessorFacade = $ emulatedProcessorFacade ;
75
+ $ this ->emulatedAreaProcessor = $ emulatedAreaProcessor ;
68
76
$ this ->changeDetector = $ changeDetector ;
69
77
$ this ->hash = $ hash ;
78
+ $ this ->processorFacadeFactory = $ processorFacadeFactory ;
70
79
71
80
parent ::__construct ();
72
81
}
@@ -128,13 +137,15 @@ protected function execute(InputInterface $input, OutputInterface $output)
128
137
}
129
138
130
139
try {
131
- $ message = $ this ->emulatedProcessorFacade ->process (
132
- $ input ->getArgument (static ::ARG_PATH ),
133
- $ input ->getArgument (static ::ARG_VALUE ),
134
- $ input ->getOption (static ::OPTION_SCOPE ),
135
- $ input ->getOption (static ::OPTION_SCOPE_CODE ),
136
- $ input ->getOption (static ::OPTION_LOCK )
137
- );
140
+ $ message = $ this ->emulatedAreaProcessor ->process (function () use ($ input ) {
141
+ return $ this ->processorFacadeFactory ->create ()->process (
142
+ $ input ->getArgument (static ::ARG_PATH ),
143
+ $ input ->getArgument (static ::ARG_VALUE ),
144
+ $ input ->getOption (static ::OPTION_SCOPE ),
145
+ $ input ->getOption (static ::OPTION_SCOPE_CODE ),
146
+ $ input ->getOption (static ::OPTION_LOCK )
147
+ );
148
+ });
138
149
139
150
$ this ->hash ->regenerate (System::CONFIG_TYPE );
140
151
0 commit comments