File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed
lib/internal/Magento/Framework Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
2
/**
3
- * Copyright © Magento, Inc. All rights reserved.
4
- * See COPYING.txt for license details .
3
+ * Copyright 2014 Adobe
4
+ * All rights reserved .
5
5
*/
6
6
declare (strict_types=1 );
7
7
@@ -68,6 +68,11 @@ class Bootstrap
68
68
*/
69
69
const INIT_PARAM_FILESYSTEM_DRIVERS = 'MAGE_FILESYSTEM_DRIVERS ' ;
70
70
71
+ /**
72
+ * Initialization parameter for magento mode
73
+ */
74
+ const INIT_PARAM_MAGE_MODE = 'MAGE_MODE ' ;
75
+
71
76
/**
72
77
* The initialization parameters (normally come from the $_SERVER)
73
78
*
Original file line number Diff line number Diff line change @@ -177,10 +177,15 @@ private function initObjectManager()
177
177
$ params = (new ComplexParameter (self ::INPUT_KEY_BOOTSTRAP ))->mergeFromArgv ($ _SERVER , $ _SERVER );
178
178
$ params [Bootstrap::PARAM_REQUIRE_MAINTENANCE ] = null ;
179
179
$ requestParams = $ this ->serviceManager ->get ('magento-init-params ' );
180
+ $ appBootstrapKeys = [
181
+ Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS ,
182
+ Bootstrap::INIT_PARAM_MAGE_MODE ,
183
+ ];
180
184
181
- // Merge ALL magento-init-params, not just filesystem paths
182
- if (!empty ($ requestParams ) && is_array ($ requestParams )) {
183
- $ params = array_replace_recursive ($ params , $ requestParams );
185
+ foreach ($ appBootstrapKeys as $ appBootstrapKey ) {
186
+ if (isset ($ requestParams [$ appBootstrapKey ]) && !isset ($ params [$ appBootstrapKey ])) {
187
+ $ params [$ appBootstrapKey ] = $ requestParams [$ appBootstrapKey ];
188
+ }
184
189
}
185
190
186
191
$ this ->objectManager = Bootstrap::create (BP , $ params )->getObjectManager ();
You can’t perform that action at this time.
0 commit comments