Skip to content

Commit 0b78570

Browse files
merge magento/2.3.3-develop into magento-trigger/MC-18977
2 parents 410d421 + 0ccf828 commit 0b78570

File tree

14 files changed

+14
-383
lines changed

14 files changed

+14
-383
lines changed

dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/acceptance.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
</allow>
2222
<deny>
2323
<tag group="stable" value="no" />
24+
<tag group="mftf_migrated" value="yes" />
2425
</deny>
2526
</rule>
2627
</config>

lib/internal/Magento/Framework/Config/ConfigOptionsListConstants.php

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ class ConfigOptionsListConstants
2121
const CONFIG_PATH_CRYPT_KEY = 'crypt/key';
2222
const CONFIG_PATH_SESSION_SAVE = 'session/save';
2323
const CONFIG_PATH_RESOURCE_DEFAULT_SETUP = 'resource/default_setup/connection';
24-
const CONFIG_PATH_DB_CONNECTION_DEFAULT_DRIVER_OPTIONS = 'db/connection/default/driver_options';
2524
const CONFIG_PATH_DB_CONNECTION_DEFAULT = 'db/connection/default';
2625
const CONFIG_PATH_DB_CONNECTIONS = 'db/connection';
2726
const CONFIG_PATH_DB_PREFIX = 'db/table_prefix';
@@ -65,10 +64,6 @@ class ConfigOptionsListConstants
6564
const INPUT_KEY_DB_MODEL = 'db-model';
6665
const INPUT_KEY_DB_INIT_STATEMENTS = 'db-init-statements';
6766
const INPUT_KEY_DB_ENGINE = 'db-engine';
68-
const INPUT_KEY_DB_SSL_KEY = 'db-ssl-key';
69-
const INPUT_KEY_DB_SSL_CERT = 'db-ssl-cert';
70-
const INPUT_KEY_DB_SSL_CA = 'db-ssl-ca';
71-
const INPUT_KEY_DB_SSL_VERIFY = 'db-ssl-verify';
7267
const INPUT_KEY_RESOURCE = 'resource';
7368
const INPUT_KEY_SKIP_DB_VALIDATION = 'skip-db-validation';
7469
const INPUT_KEY_CACHE_HOSTS = 'http-cache-hosts';
@@ -109,20 +104,6 @@ class ConfigOptionsListConstants
109104
const KEY_MODEL = 'model';
110105
const KEY_INIT_STATEMENTS = 'initStatements';
111106
const KEY_ACTIVE = 'active';
112-
const KEY_DRIVER_OPTIONS = 'driver_options';
113-
/**#@-*/
114-
115-
/**#@+
116-
* Array keys for database driver options configurations
117-
*/
118-
const KEY_MYSQL_SSL_KEY = \PDO::MYSQL_ATTR_SSL_KEY;
119-
const KEY_MYSQL_SSL_CERT = \PDO::MYSQL_ATTR_SSL_CERT;
120-
const KEY_MYSQL_SSL_CA = \PDO::MYSQL_ATTR_SSL_CA;
121-
/**
122-
* Constant \PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT cannot be used as it was introduced in PHP 7.1.4
123-
* and Magento 2 is currently supporting PHP 7.1.3.
124-
*/
125-
const KEY_MYSQL_SSL_VERIFY = 1014;
126107
/**#@-*/
127108

128109
/**

setup/src/Magento/Setup/Controller/DatabaseCheck.php

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*/
66
namespace Magento\Setup\Controller;
77

8-
use Magento\Framework\Config\ConfigOptionsListConstants;
98
use Magento\Setup\Validator\DbValidator;
109
use Zend\Json\Json;
1110
use Zend\Mvc\Controller\AbstractActionController;
@@ -41,45 +40,12 @@ public function indexAction()
4140
try {
4241
$params = Json::decode($this->getRequest()->getContent(), Json::TYPE_ARRAY);
4342
$password = isset($params['password']) ? $params['password'] : '';
44-
$driverOptions = [];
45-
if ($this->isDriverOptionsGiven($params)) {
46-
if (empty($params['driverOptionsSslVerify'])) {
47-
$params['driverOptionsSslVerify'] = 0;
48-
}
49-
$driverOptions = [
50-
ConfigOptionsListConstants::KEY_MYSQL_SSL_KEY => $params['driverOptionsSslKey'],
51-
ConfigOptionsListConstants::KEY_MYSQL_SSL_CERT => $params['driverOptionsSslCert'],
52-
ConfigOptionsListConstants::KEY_MYSQL_SSL_CA => $params['driverOptionsSslCa'],
53-
ConfigOptionsListConstants::KEY_MYSQL_SSL_VERIFY => (int) $params['driverOptionsSslVerify'],
54-
];
55-
}
56-
$this->dbValidator->checkDatabaseConnectionWithDriverOptions(
57-
$params['name'],
58-
$params['host'],
59-
$params['user'],
60-
$password,
61-
$driverOptions
62-
);
43+
$this->dbValidator->checkDatabaseConnection($params['name'], $params['host'], $params['user'], $password);
6344
$tablePrefix = isset($params['tablePrefix']) ? $params['tablePrefix'] : '';
6445
$this->dbValidator->checkDatabaseTablePrefix($tablePrefix);
6546
return new JsonModel(['success' => true]);
6647
} catch (\Exception $e) {
6748
return new JsonModel(['success' => false, 'error' => $e->getMessage()]);
6849
}
6950
}
70-
71-
/**
72-
* Is Driver Options Given
73-
*
74-
* @param array $params
75-
* @return bool
76-
*/
77-
private function isDriverOptionsGiven($params)
78-
{
79-
return !(
80-
empty($params['driverOptionsSslKey']) ||
81-
empty($params['driverOptionsSslCert']) ||
82-
empty($params['driverOptionsSslCa'])
83-
);
84-
}
8551
}

setup/src/Magento/Setup/Model/ConfigGenerator.php

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Magento\Framework\Config\ConfigOptionsListConstants;
1515
use Magento\Framework\App\State;
1616
use Magento\Framework\Math\Random;
17-
use Magento\Setup\Model\ConfigOptionsList\DriverOptions;
1817

1918
/**
2019
* Creates deployment config data based on user input array
@@ -63,32 +62,24 @@ class ConfigGenerator
6362
*/
6463
private $cryptKeyGenerator;
6564

66-
/**
67-
* @var DriverOptions
68-
*/
69-
private $driverOptions;
70-
7165
/**
7266
* Constructor
7367
*
7468
* @param Random $random Deprecated since 100.2.0
7569
* @param DeploymentConfig $deploymentConfig
7670
* @param ConfigDataFactory|null $configDataFactory
7771
* @param CryptKeyGeneratorInterface|null $cryptKeyGenerator
78-
* @param DriverOptions|null $driverOptions
7972
*/
8073
public function __construct(
8174
Random $random,
8275
DeploymentConfig $deploymentConfig,
8376
ConfigDataFactory $configDataFactory = null,
84-
CryptKeyGeneratorInterface $cryptKeyGenerator = null,
85-
DriverOptions $driverOptions = null
77+
CryptKeyGeneratorInterface $cryptKeyGenerator = null
8678
) {
8779
$this->random = $random;
8880
$this->deploymentConfig = $deploymentConfig;
8981
$this->configDataFactory = $configDataFactory ?? ObjectManager::getInstance()->get(ConfigDataFactory::class);
9082
$this->cryptKeyGenerator = $cryptKeyGenerator ?? ObjectManager::getInstance()->get(CryptKeyGenerator::class);
91-
$this->driverOptions = $driverOptions ?? ObjectManager::getInstance()->get(DriverOptions::class);
9283
}
9384

9485
/**
@@ -190,9 +181,6 @@ public function createDbConfig(array $data)
190181
$configData->set($dbConnectionPrefix . ConfigOptionsListConstants::KEY_ACTIVE, '1');
191182
}
192183

193-
$driverOptions = $this->driverOptions->getDriverOptions($data);
194-
$configData->set($dbConnectionPrefix . ConfigOptionsListConstants::KEY_DRIVER_OPTIONS, $driverOptions);
195-
196184
return $configData;
197185
}
198186

setup/src/Magento/Setup/Model/ConfigOptionsList.php

Lines changed: 5 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
use Magento\Framework\Encryption\KeyValidator;
1212
use Magento\Framework\Setup\ConfigOptionsListInterface;
1313
use Magento\Framework\Setup\Option\FlagConfigOption;
14-
use Magento\Framework\Setup\Option\SelectConfigOption;
1514
use Magento\Framework\Setup\Option\TextConfigOption;
16-
use Magento\Setup\Model\ConfigOptionsList\DriverOptions;
1715
use Magento\Setup\Validator\DbValidator;
1816

1917
/**
@@ -55,24 +53,17 @@ class ConfigOptionsList implements ConfigOptionsListInterface
5553
\Magento\Setup\Model\ConfigOptionsList\Lock::class,
5654
];
5755

58-
/**
59-
* @var DriverOptions
60-
*/
61-
private $driverOptions;
62-
6356
/**
6457
* Constructor
6558
*
6659
* @param ConfigGenerator $configGenerator
6760
* @param DbValidator $dbValidator
6861
* @param KeyValidator|null $encryptionKeyValidator
69-
* @param DriverOptions|null $driverOptions
7062
*/
7163
public function __construct(
7264
ConfigGenerator $configGenerator,
7365
DbValidator $dbValidator,
74-
KeyValidator $encryptionKeyValidator = null,
75-
DriverOptions $driverOptions = null
66+
KeyValidator $encryptionKeyValidator = null
7667
) {
7768
$this->configGenerator = $configGenerator;
7869
$this->dbValidator = $dbValidator;
@@ -81,7 +72,6 @@ public function __construct(
8172
$this->configOptionsCollection[] = $objectManager->get($className);
8273
}
8374
$this->encryptionKeyValidator = $encryptionKeyValidator ?: $objectManager->get(KeyValidator::class);
84-
$this->driverOptions = $driverOptions ?? $objectManager->get(DriverOptions::class);
8575
}
8676

8777
/**
@@ -172,39 +162,10 @@ public function getOptions()
172162
ConfigOptionsListConstants::CONFIG_PATH_CACHE_HOSTS,
173163
'http Cache hosts'
174164
),
175-
new TextConfigOption(
176-
ConfigOptionsListConstants::INPUT_KEY_DB_SSL_KEY,
177-
TextConfigOption::FRONTEND_WIZARD_TEXT,
178-
ConfigOptionsListConstants::CONFIG_PATH_DB_CONNECTION_DEFAULT_DRIVER_OPTIONS .
179-
'/' . ConfigOptionsListConstants::KEY_MYSQL_SSL_KEY,
180-
'Full path of client key file in order to establish db connection through SSL',
181-
null
182-
),
183-
new TextConfigOption(
184-
ConfigOptionsListConstants::INPUT_KEY_DB_SSL_CERT,
185-
TextConfigOption::FRONTEND_WIZARD_TEXT,
186-
ConfigOptionsListConstants::CONFIG_PATH_DB_CONNECTION_DEFAULT_DRIVER_OPTIONS .
187-
'/' . ConfigOptionsListConstants::KEY_MYSQL_SSL_CERT,
188-
'Full path of client certificate file in order to establish db connection through SSL',
189-
null
190-
),
191-
new TextConfigOption(
192-
ConfigOptionsListConstants::INPUT_KEY_DB_SSL_CA,
193-
TextConfigOption::FRONTEND_WIZARD_TEXT,
194-
ConfigOptionsListConstants::CONFIG_PATH_DB_CONNECTION_DEFAULT_DRIVER_OPTIONS .
195-
'/' . ConfigOptionsListConstants::KEY_MYSQL_SSL_CA,
196-
'Full path of server certificate file in order to establish db connection through SSL',
197-
null
198-
),
199-
new FlagConfigOption(
200-
ConfigOptionsListConstants::INPUT_KEY_DB_SSL_VERIFY,
201-
ConfigOptionsListConstants::CONFIG_PATH_DB_CONNECTION_DEFAULT_DRIVER_OPTIONS .
202-
'/' . ConfigOptionsListConstants::KEY_MYSQL_SSL_VERIFY,
203-
'Verify server certification'
204-
),
205165
];
206166

207167
foreach ($this->configOptionsCollection as $configOptionsList) {
168+
// phpcs:ignore Magento2.Performance.ForeachArrayMerge
208169
$options = array_merge($options, $configOptionsList->getOptions());
209170
}
210171

@@ -261,6 +222,7 @@ public function validate(array $options, DeploymentConfig $deploymentConfig)
261222
}
262223

263224
foreach ($this->configOptionsCollection as $configOptionsList) {
225+
// phpcs:ignore Magento2.Performance.ForeachArrayMerge
264226
$errors = array_merge($errors, $configOptionsList->validate($options, $deploymentConfig));
265227
}
266228

@@ -387,14 +349,12 @@ private function validateDbSettings(array $options, DeploymentConfig $deployment
387349
) {
388350
try {
389351
$options = $this->getDbSettings($options, $deploymentConfig);
390-
$driverOptions = $this->driverOptions->getDriverOptions($options);
391352

392-
$this->dbValidator->checkDatabaseConnectionWithDriverOptions(
353+
$this->dbValidator->checkDatabaseConnection(
393354
$options[ConfigOptionsListConstants::INPUT_KEY_DB_NAME],
394355
$options[ConfigOptionsListConstants::INPUT_KEY_DB_HOST],
395356
$options[ConfigOptionsListConstants::INPUT_KEY_DB_USER],
396-
$options[ConfigOptionsListConstants::INPUT_KEY_DB_PASSWORD],
397-
$driverOptions
357+
$options[ConfigOptionsListConstants::INPUT_KEY_DB_PASSWORD]
398358
);
399359
} catch (\Exception $exception) {
400360
$errors[] = $exception->getMessage();

setup/src/Magento/Setup/Model/ConfigOptionsList/DriverOptions.php

Lines changed: 0 additions & 72 deletions
This file was deleted.

setup/src/Magento/Setup/Model/Installer.php

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,32 +1371,7 @@ private function deleteDeploymentConfig()
13711371
*/
13721372
private function assertDbAccessible()
13731373
{
1374-
$driverOptionKeys = [
1375-
ConfigOptionsListConstants::KEY_MYSQL_SSL_KEY =>
1376-
ConfigOptionsListConstants::CONFIG_PATH_DB_CONNECTION_DEFAULT_DRIVER_OPTIONS . '/' .
1377-
ConfigOptionsListConstants::KEY_MYSQL_SSL_KEY,
1378-
1379-
ConfigOptionsListConstants::KEY_MYSQL_SSL_CERT =>
1380-
ConfigOptionsListConstants::CONFIG_PATH_DB_CONNECTION_DEFAULT_DRIVER_OPTIONS . '/' .
1381-
ConfigOptionsListConstants::KEY_MYSQL_SSL_CERT,
1382-
1383-
ConfigOptionsListConstants::KEY_MYSQL_SSL_CA =>
1384-
ConfigOptionsListConstants::CONFIG_PATH_DB_CONNECTION_DEFAULT_DRIVER_OPTIONS . '/' .
1385-
ConfigOptionsListConstants::KEY_MYSQL_SSL_CA,
1386-
1387-
ConfigOptionsListConstants::KEY_MYSQL_SSL_VERIFY =>
1388-
ConfigOptionsListConstants::CONFIG_PATH_DB_CONNECTION_DEFAULT_DRIVER_OPTIONS . '/' .
1389-
ConfigOptionsListConstants::KEY_MYSQL_SSL_VERIFY
1390-
];
1391-
$driverOptions = [];
1392-
foreach ($driverOptionKeys as $driverOptionKey => $driverOptionConfig) {
1393-
$config = $this->deploymentConfig->get($driverOptionConfig);
1394-
if ($config !== null) {
1395-
$driverOptions[$driverOptionKey] = $config;
1396-
}
1397-
}
1398-
1399-
$this->dbValidator->checkDatabaseConnectionWithDriverOptions(
1374+
$this->dbValidator->checkDatabaseConnection(
14001375
$this->deploymentConfig->get(
14011376
ConfigOptionsListConstants::CONFIG_PATH_DB_CONNECTION_DEFAULT .
14021377
'/' . ConfigOptionsListConstants::KEY_NAME
@@ -1412,8 +1387,7 @@ private function assertDbAccessible()
14121387
$this->deploymentConfig->get(
14131388
ConfigOptionsListConstants::CONFIG_PATH_DB_CONNECTION_DEFAULT .
14141389
'/' . ConfigOptionsListConstants::KEY_PASSWORD
1415-
),
1416-
$driverOptions
1390+
)
14171391
);
14181392
$prefix = $this->deploymentConfig->get(
14191393
ConfigOptionsListConstants::CONFIG_PATH_DB_CONNECTION_DEFAULT .

setup/src/Magento/Setup/Model/RequestDataConverter.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,6 @@ private function convertDeploymentConfigForm(array $source)
5151
isset($source['db']['tablePrefix']) ? $source['db']['tablePrefix'] : '';
5252
$result[BackendConfigOptionsList::INPUT_KEY_BACKEND_FRONTNAME] = isset($source['config']['address']['admin'])
5353
? $source['config']['address']['admin'] : '';
54-
$result[SetupConfigOptionsList::INPUT_KEY_DB_SSL_KEY] = isset($source['db']['driverOptionsSslKey'])
55-
? $source['db']['driverOptionsSslKey'] : '';
56-
$result[SetupConfigOptionsList::INPUT_KEY_DB_SSL_CERT] = isset($source['db']['driverOptionsSslCert'])
57-
? $source['db']['driverOptionsSslCert'] : '';
58-
$result[SetupConfigOptionsList::INPUT_KEY_DB_SSL_CA] = isset($source['db']['driverOptionsSslCa'])
59-
? $source['db']['driverOptionsSslCa'] : '';
60-
$result[SetupConfigOptionsList::INPUT_KEY_DB_SSL_VERIFY] = isset($source['db']['driverOptionsSslVerify'])
61-
? $source['db']['driverOptionsSslVerify'] : '';
6254
$result[SetupConfigOptionsList::INPUT_KEY_ENCRYPTION_KEY] = isset($source['config']['encrypt']['key'])
6355
? $source['config']['encrypt']['key'] : null;
6456
$result[SetupConfigOptionsList::INPUT_KEY_SESSION_SAVE] = isset($source['config']['sessionSave']['type'])

0 commit comments

Comments
 (0)