From d367318088c2044427a574b1e42c48deade1bec3 Mon Sep 17 00:00:00 2001 From: Thomas Pulzer Date: Wed, 6 Jul 2016 09:58:38 +0200 Subject: Added occ install option for database-port. Extended the database setup to store the database port. Changed the PostgreSQL connection error message for clarification. --- lib/private/Setup/MySQL.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/private/Setup/MySQL.php') diff --git a/lib/private/Setup/MySQL.php b/lib/private/Setup/MySQL.php index 1467eb734d7..1ff7b278b86 100644 --- a/lib/private/Setup/MySQL.php +++ b/lib/private/Setup/MySQL.php @@ -100,8 +100,14 @@ class MySQL extends AbstractDatabase { 'tablePrefix' => $this->tablePrefix, ); - // adding port support - if (strpos($this->dbHost, ':')) { + // adding port support through installer + if(!empty($this->dbPort)) { + if (ctype_digit($this->dbPort)) { + $connectionParams['port'] = $this->dbPort; + } else { + $connectionParams['unix_socket'] = $this->dbPort; + } + } else if (strpos($this->dbHost, ':')) { // Host variable may carry a port or socket. list($host, $portOrSocket) = explode(':', $this->dbHost, 2); if (ctype_digit($portOrSocket)) { -- cgit v1.2.3