error update

This commit is contained in:
RundelhausCode 2021-04-06 12:24:45 +02:00
parent 4ac00af622
commit 3f02668047
2 changed files with 4 additions and 4 deletions

View File

@ -85,13 +85,12 @@ if(isset($_POST["dbSetup"])){
file_put_contents($conFilePath, json_encode($dbCon)); file_put_contents($conFilePath, json_encode($dbCon));
require_once('../bootstrap.php');
try{ try{
$capsule->Connection()->getPdo(); require_once('../bootstrap.php');
} catch (\Exception $e) { } catch (\Exception $e) {
http_response_code(400);
file_put_contents($conFilePath, NULL); file_put_contents($conFilePath, NULL);
echo json_encode(["message" => "Could not connect to the database. Please check your configuration. error:"]); http_response_code(400);
echo json_encode(["message" => "Could not connect to the database. Please check your configuration. error:" . $e]);
exit(); exit();
} }
require_once ('Database/databaseMigration.php'); require_once ('Database/databaseMigration.php');

View File

@ -6,3 +6,4 @@ $con = json_decode(file_get_contents('config/database.json', true), true);
$capsule->addConnection($con); $capsule->addConnection($con);
$capsule->setAsGlobal(); $capsule->setAsGlobal();
$capsule->bootEloquent(); $capsule->bootEloquent();
$capsule->Connection()->getPdo();