12
12
use Magento \Framework \App \Config \ConfigPathResolver ;
13
13
use Magento \Framework \App \Config \Value ;
14
14
use Magento \Framework \App \Config \ValueFactory ;
15
- use Magento \Framework \App \DeploymentConfig \ Writer ;
15
+ use Magento \Framework \App \DeploymentConfig ;
16
16
use Magento \Framework \Config \File \ConfigFilePool ;
17
17
use Magento \Framework \Exception \CouldNotSaveException ;
18
18
use Magento \Framework \Exception \FileSystemException ;
28
28
class LockProcessor implements ConfigSetProcessorInterface
29
29
{
30
30
/**
31
- * @var Writer
31
+ * @var DeploymentConfig
32
+ */
33
+ private $ deploymentConfig ;
34
+
35
+ /**
36
+ * @var DeploymentConfig\Writer
32
37
*/
33
38
private $ deploymentConfigWriter ;
34
39
@@ -53,19 +58,22 @@ class LockProcessor implements ConfigSetProcessorInterface
53
58
private $ configValueFactory ;
54
59
55
60
/**
56
- * @param Writer $writer
61
+ * @param DeploymentConfig $deploymentConfig
62
+ * @param DeploymentConfig\Writer $writer
57
63
* @param ArrayManager $arrayManager
58
64
* @param ConfigPathResolver $configPathResolver
59
65
* @param Structure $configStructure
60
66
* @param ValueFactory $configValueFactory
61
67
*/
62
68
public function __construct (
63
- Writer $ writer ,
69
+ DeploymentConfig $ deploymentConfig ,
70
+ DeploymentConfig \Writer $ writer ,
64
71
ArrayManager $ arrayManager ,
65
72
ConfigPathResolver $ configPathResolver ,
66
73
Structure $ configStructure ,
67
74
ValueFactory $ configValueFactory
68
75
) {
76
+ $ this ->deploymentConfig = $ deploymentConfig ;
69
77
$ this ->deploymentConfigWriter = $ writer ;
70
78
$ this ->arrayManager = $ arrayManager ;
71
79
$ this ->configPathResolver = $ configPathResolver ;
@@ -88,9 +96,11 @@ public function process(InputInterface $input)
88
96
$ configPath = $ this ->configPathResolver ->resolve ($ path , $ scope , $ scopeCode , System::CONFIG_TYPE );
89
97
90
98
/** @var Field $field */
91
- $ field = $ this ->configStructure ->getElement ($ path );
99
+ $ field = $ this ->deploymentConfig ->isAvailable ()
100
+ ? $ this ->configStructure ->getElement ($ path )
101
+ : null ;
92
102
/** @var Value $backendModel */
93
- $ backendModel = $ field ->hasBackendModel ()
103
+ $ backendModel = $ field && $ field ->hasBackendModel ()
94
104
? $ field ->getBackendModel ()
95
105
: $ this ->configValueFactory ->create ();
96
106
0 commit comments