added options for testing
This commit is contained in:
parent
91ea53275e
commit
2965e9b7ce
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue