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 11<?php
22/**
3- * Copyright © Magento, Inc. All rights reserved.
4- * See COPYING.txt for license details .
3+ * Copyright 2014 Adobe
4+ * All rights reserved .
55 */
66declare (strict_types=1 );
77
@@ -68,6 +68,11 @@ class Bootstrap
6868 */
6969 const INIT_PARAM_FILESYSTEM_DRIVERS = 'MAGE_FILESYSTEM_DRIVERS ' ;
7070
71+ /**
72+ * Initialization parameter for magento mode
73+ */
74+ const INIT_PARAM_MAGE_MODE = 'MAGE_MODE ' ;
75+
7176 /**
7277 * The initialization parameters (normally come from the $_SERVER)
7378 *
Original file line number Diff line number Diff line change @@ -177,10 +177,15 @@ private function initObjectManager()
177177 $ params = (new ComplexParameter (self ::INPUT_KEY_BOOTSTRAP ))->mergeFromArgv ($ _SERVER , $ _SERVER );
178178 $ params [Bootstrap::PARAM_REQUIRE_MAINTENANCE ] = null ;
179179 $ requestParams = $ this ->serviceManager ->get ('magento-init-params ' );
180+ $ appBootstrapKeys = [
181+ Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS ,
182+ Bootstrap::INIT_PARAM_MAGE_MODE ,
183+ ];
180184
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+ }
184189 }
185190
186191 $ this ->objectManager = Bootstrap::create (BP , $ params )->getObjectManager ();
You can’t perform that action at this time.
0 commit comments