Skip to content

Commit

Permalink
Merge branch 'v3' of https://github.com/craftcms/cms into develop
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/db/mysql/Schema.php

Resolves #12596
  • Loading branch information
brandonkelly committed Feb 3, 2023
2 parents 574d676 + 6a2bcdd commit a301aca
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- Fixed a bug where textual condition rules were still showing a text input when the “is empty” or “has a value” operators were selected. ([#12587](https://github.com/craftcms/cms/pull/12587))
- Fixed a bug where the component name comments in project config YAML files would always lag behind the current project config a little. ([#12576](https://github.com/craftcms/cms/issues/12576), ([#12581](https://github.com/craftcms/cms/pull/12581)))
- Fixed a MySQL error that occurred when creating a database backup using the default backup command, when running MySQL 5.7.41+ or 8.0.32+. ([#12557](https://github.com/craftcms/cms/issues/12557), [#12560](https://github.com/craftcms/cms/pull/12560))
- Fixed a bug where database backups weren’t respecting SSL database connection settings if they were specified when using MySQL. ([#10351](https://github.com/craftcms/cms/issues/10351), [#11753](https://github.com/craftcms/cms/issues/11753), [#12596](https://github.com/craftcms/cms/pull/12596))
- Fixed a bug where element indexes could stop showing their loading spinner prematurely if the element listing needed to be reloaded multiple times in rapid succession. ([#12595](https://github.com/craftcms/cms/issues/12595))
- Added `craft\helpers\Db::escapeForLike()`.
- `craft\services\Assets::getAllDescendantFolders()` now has a `$withParent` argument, which can be passed `false` to omit the parent folder from the results. ([#12536](https://github.com/craftcms/cms/issues/12536))
Expand Down
12 changes: 12 additions & 0 deletions src/db/mysql/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use craft\helpers\FileHelper;
use craft\helpers\StringHelper;
use mikehaertl\shellcommand\Command as ShellCommand;
use PDO;
use PDOException;
use yii\base\ErrorException;
use yii\base\NotSupportedException;
Expand Down Expand Up @@ -409,6 +410,17 @@ private function _createDumpConfigFile(): string
PHP_EOL . 'port=' . ($parsed['port'] ?? '');
}

// Certificates
if (isset($this->db->attributes[PDO::MYSQL_ATTR_SSL_CA])) {
$contents .= PHP_EOL . 'ssl_ca=' . $this->db->attributes[PDO::MYSQL_ATTR_SSL_CA];
}
if (isset($this->db->attributes[PDO::MYSQL_ATTR_SSL_CERT])) {
$contents .= PHP_EOL . 'ssl_cert=' . $this->db->attributes[PDO::MYSQL_ATTR_SSL_CERT];
}
if (isset($this->db->attributes[PDO::MYSQL_ATTR_SSL_KEY])) {
$contents .= PHP_EOL . 'ssl_key=' . $this->db->attributes[PDO::MYSQL_ATTR_SSL_KEY];
}

FileHelper::writeToFile($this->tempMyCnfPath, '');
// Avoid a “world-writable config file 'my.cnf' is ignored” warning
chmod($this->tempMyCnfPath, 0600);
Expand Down

0 comments on commit a301aca

Please sign in to comment.