From b09e8fff28c839df9244a2d8ad6c5a37608d5f5d Mon Sep 17 00:00:00 2001 From: Augusto Gunsch Date: Fri, 29 Jul 2022 11:54:09 +0200 Subject: [PATCH] Remove hard coded credentials --- src/Model/Database.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/Model/Database.php b/src/Model/Database.php index e6cf64f..189074c 100644 --- a/src/Model/Database.php +++ b/src/Model/Database.php @@ -8,15 +8,10 @@ define("FURNITURE", "furniture"); class Database { - const SERVERNAME = "127.0.0.1"; - const DATABASE = "scandiweb"; - const USERNAME = "root"; - const PASSWORD = "root"; - public static function connect() { - $conn = new \mysqli(self::SERVERNAME, self::USERNAME, self::PASSWORD); - $conn->select_db(self::DATABASE); + $conn = new \mysqli(getenv('SERVERNAME'), getenv('USERNAME'), getenv('PASSWORD')); + $conn->select_db(getenv('DATABASE')); return $conn; } }