Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e96b0e7

Browse files
committed
minor #39463 [Mailer] [Amazon] Ensure "ext-simplexml" is loaded if SesApiTransport is used (OskarStark)
This PR was squashed before being merged into the 4.4 branch. Discussion ---------- [Mailer] [Amazon] Ensure "ext-simplexml" is loaded if SesApiTransport is used | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | --- | License | MIT | Doc PR | --- For reference: https://github.com/symfony/symfony/blob/150d8506e425212bbdc0e75b7d5fc4e6710f0852/src/Symfony/Component/Mailer/Bridge/Amazon/Transport/SesApiTransport.php#L66-L69 Commits ------- a40d137 [Mailer] [Amazon] Ensure "ext-simplexml" is loaded if SesApiTransport is used
2 parents 698dadc + a40d137 commit e96b0e7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Symfony/Component/Mailer/Bridge/Amazon/Transport/SesTransportFactory.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Mailer\Bridge\Amazon\Transport;
1313

14+
use Symfony\Component\Mailer\Exception\LogicException;
1415
use Symfony\Component\Mailer\Exception\UnsupportedSchemeException;
1516
use Symfony\Component\Mailer\Transport\AbstractTransportFactory;
1617
use Symfony\Component\Mailer\Transport\Dsn;
@@ -31,6 +32,10 @@ public function create(Dsn $dsn): TransportInterface
3132
$port = $dsn->getPort();
3233

3334
if ('ses+api' === $scheme) {
35+
if (!\extension_loaded('simplexml')) {
36+
throw new LogicException(sprintf('Cannot use "%s". Make sure you have "ext-simplexml" installed and enabled.', SesApiTransport::class));
37+
}
38+
3439
return (new SesApiTransport($user, $password, $region, $this->client, $this->dispatcher, $this->logger))->setHost($host)->setPort($port);
3540
}
3641

0 commit comments

Comments
 (0)