From 0564f5e1c4d85d34ec14a493dfa529fb724878d1 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 5 Sep 2016 21:09:15 +0200 Subject: Support custom MySQL ports https://github.com/FreshRSS/FreshRSS/issues/1241 --- app/install.php | 2 +- lib/Minz/ModelPdo.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/install.php b/app/install.php index 62695ceb6..dad3535dc 100644 --- a/app/install.php +++ b/app/install.php @@ -716,7 +716,7 @@ function printStep3() {
- +
diff --git a/lib/Minz/ModelPdo.php b/lib/Minz/ModelPdo.php index 845aecaae..f82045df9 100644 --- a/lib/Minz/ModelPdo.php +++ b/lib/Minz/ModelPdo.php @@ -53,13 +53,17 @@ class Minz_ModelPdo { self::$sharedCurrentUser = $currentUser; $driver_options = isset($conf->db['pdo_options']) && is_array($conf->db['pdo_options']) ? $conf->db['pdo_options'] : array(); + $dbServer = parse_url('db://' . $db['host']); try { $type = $db['type']; if ($type === 'mysql') { - $string = 'mysql:host=' . $db['host'] + $string = 'mysql:host=' . $dbServer['host'] . ';dbname=' . $db['base'] . ';charset=utf8mb4'; + if (!empty($dbServer['port'])) { + $string .= ';port=' . $dbServer['port']; + } $driver_options[PDO::MYSQL_ATTR_INIT_COMMAND] = 'SET NAMES utf8mb4'; $this->prefix = $db['prefix'] . $currentUser . '_'; } elseif ($type === 'sqlite') { -- cgit v1.2.3 From ede0c839cbde7a51fadf27f5b754604cbf13836c Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 11 Sep 2016 11:41:23 +0200 Subject: Changelog custom database port --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c61478b33..5628d2dd0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## 2016-XX-XX FreshRSS 1.6.0-dev +* Features + * Support custom ports `localhost:3306` for database servers [#1241](https://github.com/FreshRSS/FreshRSS/issues/1241) * UI * Download icon 💾 for podcasts [#1236](https://github.com/FreshRSS/FreshRSS/issues/1236) -- cgit v1.2.3