File tree Expand file tree Collapse file tree 5 files changed +14
-5
lines changed
lib/internal/Magento/Framework Expand file tree Collapse file tree 5 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 8
8
use Magento \Framework \App \Filesystem \DirectoryList ;
9
9
use Magento \Framework \ObjectManager \ConfigLoaderInterface ;
10
10
use Magento \Framework \Filesystem ;
11
+ use Magento \Framework \Config \ConfigOptionsListConstants ;
11
12
use Psr \Log \LoggerInterface ;
12
13
13
14
/**
@@ -117,7 +118,9 @@ public function launch()
117
118
\Magento \Framework \Profiler::reset ();
118
119
$ appMode = $ this ->state ->getMode ();
119
120
if ($ appMode == \Magento \Framework \App \State::MODE_PRODUCTION
120
- && !$ this ->deploymentConfig ->getConfigData ('static_content_on_demand_in_production ' )
121
+ && !$ this ->deploymentConfig ->getConfigData (
122
+ ConfigOptionsListConstants::CONFIG_PATH_SCD_ON_DEMAND_IN_PRODUCTION
123
+ )
121
124
) {
122
125
$ this ->response ->setHttpResponseCode (404 );
123
126
} else {
Original file line number Diff line number Diff line change 17
17
use Magento \Framework \ObjectManagerInterface ;
18
18
use Magento \Framework \App \ObjectManager \ConfigLoader ;
19
19
use Magento \Framework \App \StaticResource ;
20
+ use Magento \Framework \Config \ConfigOptionsListConstants ;
20
21
use Psr \Log \LoggerInterface ;
21
22
use PHPUnit_Framework_MockObject_MockObject as MockObject ;
22
23
@@ -152,7 +153,7 @@ public function testLaunch(
152
153
) {
153
154
$ this ->deploymentConfigMock ->expects ($ this ->exactly ($ getConfigDataExpects ))
154
155
->method ('getConfigData ' )
155
- ->with (' static_content_on_demand_in_production ' )
156
+ ->with (ConfigOptionsListConstants:: CONFIG_PATH_SCD_ON_DEMAND_IN_PRODUCTION )
156
157
->willReturn ($ staticContentOmDemandInProduction );
157
158
$ this ->stateMock ->expects ($ this ->once ())
158
159
->method ('getMode ' )
Original file line number Diff line number Diff line change 10
10
use Magento \Framework \App \State ;
11
11
use Magento \Framework \App \View \Deployment \Version \StorageInterface ;
12
12
use Psr \Log \LoggerInterface ;
13
+ use Magento \Framework \Config \ConfigOptionsListConstants ;
13
14
use PHPUnit_Framework_MockObject_MockObject as MockObject ;
14
15
15
16
/**
@@ -109,7 +110,7 @@ public function testGetValueWithProductionModeAndException()
109
110
->willReturn (State::MODE_PRODUCTION );
110
111
$ this ->deploymentConfigMock ->expects ($ this ->once ())
111
112
->method ('getConfigData ' )
112
- ->with (' static_content_on_demand_in_production ' )
113
+ ->with (ConfigOptionsListConstants:: CONFIG_PATH_SCD_ON_DEMAND_IN_PRODUCTION )
113
114
->willReturn (0 );
114
115
$ this ->loggerMock ->expects ($ this ->once ())
115
116
->method ('critical ' )
@@ -142,7 +143,7 @@ public function testGetValueWithProductionModeAndEnabledSCDonDemand()
142
143
->willReturn (State::MODE_PRODUCTION );
143
144
$ this ->deploymentConfigMock ->expects ($ this ->once ())
144
145
->method ('getConfigData ' )
145
- ->with (' static_content_on_demand_in_production ' )
146
+ ->with (ConfigOptionsListConstants:: CONFIG_PATH_SCD_ON_DEMAND_IN_PRODUCTION )
146
147
->willReturn (1 );
147
148
$ this ->versionStorageMock ->expects ($ this ->once ())
148
149
->method ('save ' );
Original file line number Diff line number Diff line change 8
8
9
9
use Magento \Framework \App \DeploymentConfig ;
10
10
use Magento \Framework \App \ObjectManager ;
11
+ use Magento \Framework \Config \ConfigOptionsListConstants ;
11
12
use Psr \Log \LoggerInterface ;
12
13
13
14
/**
@@ -79,7 +80,9 @@ protected function readValue($appMode)
79
80
$ result = $ this ->versionStorage ->load ();
80
81
if (!$ result ) {
81
82
if ($ appMode == \Magento \Framework \App \State::MODE_PRODUCTION
82
- && !$ this ->deploymentConfig ->getConfigData ('static_content_on_demand_in_production ' )
83
+ && !$ this ->deploymentConfig ->getConfigData (
84
+ ConfigOptionsListConstants::CONFIG_PATH_SCD_ON_DEMAND_IN_PRODUCTION
85
+ )
83
86
) {
84
87
$ this ->getLogger ()->critical ('Can not load static content version. ' );
85
88
throw new \UnexpectedValueException (
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ class ConfigOptionsListConstants
36
36
const CONFIG_PATH_DB_LOGGER_LOG_EVERYTHING = 'db_logger/log_everything ' ;
37
37
const CONFIG_PATH_DB_LOGGER_QUERY_TIME_THRESHOLD = 'db_logger/query_time_threshold ' ;
38
38
const CONFIG_PATH_DB_LOGGER_INCLUDE_STACKTRACE = 'db_logger/include_stacktrace ' ;
39
+ const CONFIG_PATH_SCD_ON_DEMAND_IN_PRODUCTION = 'static_content_on_demand_in_production ' ;
39
40
/**#@-*/
40
41
41
42
/**#@+
You can’t perform that action at this time.
0 commit comments