Skip to content

Commit 3e03cf2

Browse files
Revert "ACPT-1599: Fixing DeploymentConfig resets & reloads every time new key that wasn't previously set"
This reverts commit a731903ceab6881ca09875eb434a7bc4c5568f9d. This workaround didn't work for very specific use-case of custom 'etc' path when running setup:upgrade. This was found in setup-integration tests. The reason why it didn't work is because the first DeploymentConfig doesn't use the custom paths for 'etc', so it was loading the wrong files. This problem may still exist for plugins and other objects that use the original ObjectManager's DeploymentConfig instead of the DeploymentConfig object created by Laminas ServiceManager.
1 parent 530117e commit 3e03cf2

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

setup/src/Magento/Setup/Console/CommandList.php

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
namespace Magento\Setup\Console;
88

9-
use Magento\Framework\App\DeploymentConfig;
10-
use Magento\Framework\App\ObjectManager;
119
use Magento\Setup\Console\Command\TablesWhitelistGenerateCommand;
1210
use Laminas\ServiceManager\ServiceManager;
1311

@@ -18,20 +16,21 @@
1816
*/
1917
class CommandList
2018
{
19+
/**
20+
* Service Manager
21+
*
22+
* @var ServiceManager
23+
*/
24+
private $serviceManager;
25+
2126
/**
2227
* Constructor
2328
*
2429
* @param ServiceManager $serviceManager
25-
* @param DeploymentConfig|null $deploymentConfig
2630
*/
27-
public function __construct(
28-
private ServiceManager $serviceManager,
29-
?DeploymentConfig $deploymentConfig = null
30-
) {
31-
$deploymentConfig ??= ObjectManager::getInstance()->get(DeploymentConfig::class);
32-
/* Note: We must use same DeploymentConfig object in objects created by Laminas' ServiceManager, because
33-
* some commands alter deployment configuration. */
34-
$this->serviceManager->setService(DeploymentConfig::class, $deploymentConfig);
31+
public function __construct(ServiceManager $serviceManager)
32+
{
33+
$this->serviceManager = $serviceManager;
3534
}
3635

3736
/**

0 commit comments

Comments
 (0)