Skip to content

Commit e01b03d

Browse files
committed
Merge branch 'master' of github.com:chamilo/chamilo-lms
2 parents 0396784 + ad74abe commit e01b03d

File tree

2 files changed

+49
-7
lines changed

2 files changed

+49
-7
lines changed

src/CoreBundle/Migrations/Schema/V200/Version20250707212800.php

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,31 @@ private function migrateMailConf(string $oldMailConfPath): array
3434
return [];
3535
}
3636

37-
include $oldMailConfPath;
37+
/** @var array{
38+
* SMTP_USER?: string,
39+
* SMTP_PASS?: string,
40+
* SMTP_HOST?: string,
41+
* SMTP_PORT?: string,
42+
* EXCLUDE_JSON?: bool,
43+
* DKIM?: bool,
44+
* DKIM_SELECTOR?: string,
45+
* DKIM_DOMAIN?: string,
46+
* DKIM_PRIVATE_KEY_STRING?: string,
47+
* DKIM_PRIVATE_KEY?: string,
48+
* DKIM_PASSPHRASE?: string,
49+
* XOAUTH2_METHOD?: bool,
50+
* XOAUTH2_URL_AUTHORIZE?: string,
51+
* XOAUTH2_URL_ACCES_TOKEN?: string,
52+
* XOAUTH2_URL_RESOURCE_OWNER_DETAILS?: string,
53+
* XOAUTH2_SCOPES?: string,
54+
* XOAUTH2_CLIENT_ID?: string,
55+
* XOAUTH2_CLIENT_SECRET?: string,
56+
* XOAUTH2_REFRESH_TOKEN?: string,
57+
* } $platform_email
58+
*/
59+
$platform_email = [];
3860

39-
global $platform_email;
61+
include $oldMailConfPath;
4062

4163
$mailerScheme = 'null';
4264
$smtpSecure = $platform_email['SMTP_SECURE'] ?? '';
@@ -48,7 +70,7 @@ private function migrateMailConf(string $oldMailConfPath): array
4870
if ('ssl' === $smtpSecure) {
4971
$mailerScheme = 'smtps';
5072
} elseif ('tls' === $smtpSecure) {
51-
$query = '?encryption=tls';
73+
$query = '?require_tls=true';
5274
}
5375
}
5476

src/CoreBundle/Migrations/Schema/V200/Version20250721200725.php

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ public function up(Schema $schema): void
1818
$updateRootPath = $this->getUpdateRootPath();
1919
$oldMailConfPath = $updateRootPath.'/app/config/mail.conf.php';
2020

21-
$legacyMailConfig = file_exists($oldMailConfPath);
22-
2321
$envFile = $projectDir.'/.env';
2422

2523
$dotenv = new Dotenv();
@@ -40,7 +38,7 @@ public function up(Schema $schema): void
4038
if ('ssl' === $smtpSecure) {
4139
$mailerScheme = 'smtps';
4240
} elseif ('tls' === $smtpSecure) {
43-
$query = '?encryption=tls';
41+
$query = '?require_tls=true';
4442
}
4543
}
4644

@@ -61,9 +59,31 @@ public function up(Schema $schema): void
6159
$settings['mailer_debug_enable'] = !empty($_ENV['SMTP_DEBUG']) ? 'true' : 'false';
6260
}
6361

64-
if ($legacyMailConfig) {
62+
if (file_exists($oldMailConfPath)) {
63+
/** @var array{
64+
* EXCLUDE_JSON?: bool,
65+
* DKIM?: bool,
66+
* DKIM_SELECTOR?: string,
67+
* DKIM_DOMAIN?: string,
68+
* DKIM_PRIVATE_KEY_STRING?: string,
69+
* DKIM_PRIVATE_KEY?: string,
70+
* DKIM_PASSPHRASE?: string,
71+
* XOAUTH2_METHOD?: bool,
72+
* XOAUTH2_URL_AUTHORIZE?: string,
73+
* XOAUTH2_URL_ACCES_TOKEN?: string,
74+
* XOAUTH2_URL_RESOURCE_OWNER_DETAILS?: string,
75+
* XOAUTH2_SCOPES?: string,
76+
* XOAUTH2_CLIENT_ID?: string,
77+
* XOAUTH2_CLIENT_SECRET?: string,
78+
* XOAUTH2_REFRESH_TOKEN?: string,
79+
* } $platform_email
80+
*/
81+
$platform_email = [];
82+
6583
include $oldMailConfPath;
84+
6685
$settings['mailer_exclude_json'] = $platform_email['EXCLUDE_JSON'] ?? false;
86+
6787
$dkim = [
6888
'enable' => $platform_email['DKIM'] ?? false,
6989
'selector' => $platform_email['DKIM_SELECTOR'] ?? '',

0 commit comments

Comments
 (0)