From 694abf837585e5cd4a2f893b20b6f2bdeab5e5e0 Mon Sep 17 00:00:00 2001 From: Andreas Date: Fri, 27 Sep 2019 12:45:49 +0200 Subject: [PATCH] huts --- dev_mvc/model/testactions/TA_PopulateDB.php | 30 ++------------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/dev_mvc/model/testactions/TA_PopulateDB.php b/dev_mvc/model/testactions/TA_PopulateDB.php index 6545c33..60df891 100644 --- a/dev_mvc/model/testactions/TA_PopulateDB.php +++ b/dev_mvc/model/testactions/TA_PopulateDB.php @@ -5,26 +5,8 @@ class TA_PopulateDB extends TestAction{ } function execute(){ try{ - if(getenv("SQL_CREDENTIALS") !== false){ - $sql_server = getenv("SQL_SERVER"); - $sql_username = getenv("SQL_USERNAME"); - $sql_password = getenv("SQL_PASSWORD"); - $sql_database = getenv("SQL_DATABASE"); - } - else{ - $sql_server = "localhost"; - $sql_username = "root"; - $sql_password = "kankerlow"; - $sql_database = "webforum"; - } - $host = $sql_server; - $db = $sql_database; - $user = $sql_username; - $pass = $sql_password; - //connect to sql server - $con = new PDO( "mysql:host=$host;charset=utf8", $user, $pass ); - $con->exec("USE $db"); + $con = Database::connectToDB(); @@ -53,12 +35,4 @@ class TA_PopulateDB extends TestAction{ die("pdo exception, cannot connect to sql:
$e"); } } -} - - - - - - - - ?> \ No newline at end of file +} \ No newline at end of file