Skip to content

Commit

Permalink
Add mysql port env
Browse files Browse the repository at this point in the history
  • Loading branch information
Wazabii committed Mar 9, 2024
1 parent 6d6f0e1 commit 084ac54
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Kernel/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down

0 comments on commit 084ac54

Please sign in to comment.