Finalyse API, prepare databaseScript.php
continuous-integration/drone/push Build is passing Details

master
dorian.hodin 2 years ago
parent e5ea548ac2
commit 233847403d

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="SqlDialectMappings">
<file url="file://$PROJECT_DIR$/Source/API/script/Config/databaseScript.php" dialect="GenericSQL" />
<file url="file://$PROJECT_DIR$/Source/API/script/Gateway/GatewayForm.php" dialect="GenericSQL" />
<file url="file://$PROJECT_DIR$/Source/API/script/Gateway/GatewayKeyword.php" dialect="GenericSQL" />
<file url="file://$PROJECT_DIR$/Source/API/script/Gateway/GatewayListResponseOfCandidate.php" dialect="GenericSQL" />

@ -21,6 +21,7 @@ class ConnectClass{
function connect(): int|Connection
{
try {
echo " ";
$connection = new Connection($this->dsn,$this->login,$this->password);
}catch (PDOException $e){
throw new PDOException($e->getMessage(), $e->getCode(), $e);

@ -1,12 +1,17 @@
<?php
use Config\ConnectClass;
use Config\Connection;
class ScriptDatabase {
private Connection $con;
private Connection $connection;
public function __construct() {
$this->con = connect();
try{
$this->connection = (new ConnectClass)->connect();
}catch(PDOException $e){
throw new PDOException($e->getMessage(), $e->getCode(), $e);
}
}
public function executeScript(): void
@ -110,10 +115,10 @@ ALTER TABLE `Submit`
COMMIT;';
$this->con->executeQuery($queryScript);
$this->connection->executeQuery($queryScript);
try {
$test = "SELECT * FROM Categorize;";
$this->con->executeQuery($test);
$this->connection->executeQuery($test);
}catch (Exception $e){
echo $e->getMessage();
}

Loading…
Cancel
Save