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"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="SqlDialectMappings"> <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/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/GatewayKeyword.php" dialect="GenericSQL" />
<file url="file://$PROJECT_DIR$/Source/API/script/Gateway/GatewayListResponseOfCandidate.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 function connect(): int|Connection
{ {
try { try {
echo " ";
$connection = new Connection($this->dsn,$this->login,$this->password); $connection = new Connection($this->dsn,$this->login,$this->password);
}catch (PDOException $e){ }catch (PDOException $e){
throw new PDOException($e->getMessage(), $e->getCode(), $e); throw new PDOException($e->getMessage(), $e->getCode(), $e);

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

Loading…
Cancel
Save