Remove hard coded credentials

This commit is contained in:
Augusto Gunsch 2022-07-29 11:54:09 +02:00
parent 6ce3d64649
commit b09e8fff28
No known key found for this signature in database
GPG Key ID: F7EEFE29825C72DC
1 changed files with 2 additions and 7 deletions

View File

@ -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;
}
}