added options for testing

This commit is contained in:
tracer 2022-10-08 10:55:25 +02:00
parent 91ea53275e
commit 2965e9b7ce
1 changed files with 20 additions and 19 deletions

View File

@ -2,7 +2,7 @@
namespace App\Controller;
error_reporting(error_level: E_ALL);
//error_reporting(error_level: E_ALL);
use PDO;
@ -30,16 +30,17 @@ class DatabaseConnection
$dbUser = $this->configController->getConfig(configKey: 'dbUser');
$dbPassword = $this->configController->getConfig(configKey: 'dbPassword');
if (!$this->configController->getConfig(configKey: 'test')) {
// TODO create config => encryption key
try {
$this->dbConnection = new PDO(
dsn: "mysql:host=$dbHost;port=$dbPort;charset=utf8mb4;dbname=$dbDatabase",
username: $dbUser,
password: $dbPassword
);
if (!$this->configController->getConfig(configKey: 'test')) {
// TODO create config => encryption key
try {
$sql = "SHOW TABLES";
$statement = $this->dbConnection->prepare(query: $sql);
$statement->execute();
$result = $statement->fetch();