Skip to content

Commit d3ea191

Browse files
authored
Merge pull request #9815 from magento-gl/AC-14297
[Arrows] Platform Health Scop 2.4.9-alpha2
2 parents 83665d7 + 276a19b commit d3ea191

File tree

10 files changed

+959
-187
lines changed

10 files changed

+959
-187
lines changed

app/code/Magento/Email/Model/Transport.php

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport;
1717
use Symfony\Component\Mailer\Transport\Smtp\Auth\LoginAuthenticator;
1818
use Symfony\Component\Mailer\Transport\Smtp\Auth\PlainAuthenticator;
19+
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransportFactory;
1920
use Magento\Framework\App\Config\ScopeConfigInterface;
2021
use Magento\Framework\App\ObjectManager;
2122
use Magento\Framework\Exception\MailException;
@@ -78,6 +79,11 @@ class Transport implements TransportInterface
7879
*/
7980
private const XML_PATH_SSL = 'system/smtp/ssl';
8081

82+
/**
83+
* SMTP scheme constant
84+
*/
85+
private const SMTP_SCHEME = 'smtp';
86+
8187
/**
8288
* Whether return path should be set or no.
8389
*
@@ -146,7 +152,7 @@ public function __construct(
146152
public function getTransport(): SymfonyTransportInterface
147153
{
148154
if (!isset($this->symfonyTransport)) {
149-
$transportType = $this->scopeConfig->getValue(self::XML_PATH_TRANSPORT);
155+
$transportType = $this->scopeConfig->getValue(self::XML_PATH_TRANSPORT, ScopeInterface::SCOPE_STORE);
150156
if ($transportType === 'smtp') {
151157
$this->symfonyTransport = $this->createSmtpTransport();
152158
} else {
@@ -170,19 +176,27 @@ private function createSmtpTransport(): SymfonyTransportInterface
170176
$password = $this->scopeConfig->getValue(self::XML_PATH_PASSWORD, ScopeInterface::SCOPE_STORE);
171177
$auth = $this->scopeConfig->getValue(self::XML_PATH_AUTH, ScopeInterface::SCOPE_STORE);
172178
$ssl = $this->scopeConfig->getValue(self::XML_PATH_SSL, ScopeInterface::SCOPE_STORE);
173-
$tls = false;
174179

180+
$options = [];
175181
if ($ssl === 'tls') {
176-
$tls = true;
182+
$options['tls'] = true;
183+
} elseif ($ssl === 'ssl') {
184+
$options['ssl'] = true;
185+
$options['verify_peer'] = true;
186+
$options['verify_peer_name'] = true;
177187
}
178188

179-
$transport = new EsmtpTransport($host, $port, $tls);
180-
if ($username) {
181-
$transport->setUsername($username);
182-
}
183-
if ($password) {
184-
$transport->setPassword($password);
185-
}
189+
$dsn = new Dsn(
190+
self::SMTP_SCHEME,
191+
$host,
192+
$username,
193+
$password,
194+
$port,
195+
$options
196+
);
197+
198+
$factory = new EsmtpTransportFactory();
199+
$transport = $factory->create($dsn);
186200

187201
switch ($auth) {
188202
case 'plain':

composer.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
/**
3+
* Copyright 2025 Adobe
4+
* All Rights Reserved.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Framework\Cache\Backend;
9+
10+
/**
11+
* Valkey cache backend
12+
*
13+
* Valkey is a Redis-compatible in-memory store. This class extends the Redis backend
14+
* to leverage the same functionality while allowing Magento to treat Valkey as a separate backend.
15+
*/
16+
class Valkey extends Redis
17+
{
18+
/**
19+
* Backend type identifier
20+
*/
21+
public const BACKEND_TYPE = 'valkey';
22+
}

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2015 Adobe
4+
* All Rights Reserved.
55
*/
66

77
declare(strict_types=1);
@@ -104,6 +104,7 @@ class ConfigOptionsListConstants
104104
public const SESSION_SAVE_FILES = 'files';
105105
public const SESSION_SAVE_DB = 'db';
106106
public const SESSION_SAVE_REDIS = 'redis';
107+
public const SESSION_SAVE_VALKEY = 'valkey';
107108
/**#@-*/
108109

109110
/**

0 commit comments

Comments
 (0)