From 084ac546168b82b18203befbd41ee0dddddd187d Mon Sep 17 00:00:00 2001 From: Wazabii Date: Sat, 9 Mar 2024 18:59:54 +0100 Subject: [PATCH] Add mysql port env --- Kernel/App.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Kernel/App.php b/Kernel/App.php index 97f035c..654f4e3 100755 --- a/Kernel/App.php +++ b/Kernel/App.php @@ -43,11 +43,16 @@ protected function setupMysqlConnection(): void $database = $this->getenv("MYSQL_DATABASE"); if ($this->hasDBEngine && is_string($connect) && is_string($database)) { + + $port = (int)$this->getenv("MYSQL_PORT"); + if($port === 0) $port = 3306; + $connect = new Connect( $connect, $this->getenv("MYSQL_USERNAME"), $this->getenv("MYSQL_PASSWORD"), - $database + $database, + $port, ); $connect->setCharset($this->getenv("MYSQL_CHARSET")); $connect->setPrefix($this->getenv("MYSQL_PREFIX"));