TEMP : update some route with composer.json, modify the config.php file all the gateways call
continuous-integration/drone/push Build is passing Details

master
dorian.hodin 2 years ago
parent c053d20473
commit e45cc654c3

@ -10,7 +10,9 @@
"autoload": {
"psr-4": {
"ExceptionHandle\\" : "../ExceptionHandle",
"Gateway\\" : "../Gateway"
"Gateway\\" : "../Gateway",
"Config\\" : "../Config",
"Connect\\" : "../Config"
}
}
}

@ -1,26 +1,33 @@
<?php
namespace Connect;
use Config\Connection;
use PDOException;
require_once __DIR__ ."/Connection.php";
class ConnectClass{
function connect(): int|Connection
{
function connect(): int|Connection
{
$dsn = "mysql:host=".$_ENV["HOST"].";dbname=".$_ENV["DATABASE"].";";
$login = $_ENV["USER"];
$password = $_ENV["PASSWORD"];
$dsn = "mysql:host=".$_ENV["HOST"].";dbname=".$_ENV["DATABASE"].";";
$login = $_ENV["USER"];
$password = $_ENV["PASSWORD"];
try {
try {
$connection = new Connection($dsn,$login,$password);
$connection = new Connection($dsn,$login,$password);
}catch (PDOException){
}catch (PDOException){
http_response_code(404);
return http_response_code();
http_response_code(404);
return http_response_code();
}
return $connection;
}
return $connection;
}
}

@ -4,6 +4,7 @@ namespace Gateway;
use Config\Connection;
use PDO;
use Connect\ConnectClass;
class GatewayForm
{
@ -11,7 +12,7 @@ class GatewayForm
public function __construct()
{
$this->connection = connect();
$this->connection = (new ConnectClass)->connect();
}
public function insertForm(array $parameters): void

@ -3,6 +3,7 @@
namespace Gateway;
use Config\Connection;
use Connect\ConnectClass;
use PDO;
class GatewayKeyword
@ -11,7 +12,7 @@ class GatewayKeyword
public function __construct()
{
$this->connection = connect();
$this->connection = (new ConnectClass())->connect();
}
public function insertKeyword(array $keyword): void

@ -3,6 +3,7 @@
namespace Gateway;
use Config\Connection;
use Connect\ConnectClass;
use PDO;
class GatewayListResponseOfCandidate
@ -11,7 +12,7 @@ class GatewayListResponseOfCandidate
public function __construct()
{
$this->connection = connect();
$this->connection = (new ConnectClass())->connect();
}
public function getDetailsListResponsesOfCandidate(array $idListResponse): array

@ -3,6 +3,7 @@
namespace Gateway;
use Config\Connection;
use Connect\ConnectClass;
use PDO;
class GatewayPossibleResponse
@ -11,7 +12,7 @@ class GatewayPossibleResponse
public function __construct()
{
$this->connection = connect();
$this->connection = (new ConnectClass())->connect();
}
public function getPossibleResponseByQuestion(array $idQuestion): array

@ -3,6 +3,7 @@
namespace Gateway;
use Config\Connection;
use Connect\ConnectClass;
use PDO;
class GatewayQuestion
@ -11,7 +12,7 @@ class GatewayQuestion
public function __construct()
{
$this->connection = connect();
$this->connection = (new ConnectClass())->connect();
}
public function insertQuestion(QuestionAPI $question, int $idForm): void

@ -3,6 +3,7 @@
namespace Gateway;
use Config\Connection;
use Connect\ConnectClass;
use PDO;
class GatewayResponse
@ -11,7 +12,7 @@ class GatewayResponse
public function __construct()
{
$this->connection = connect();
$this->connection = (new ConnectClass())->connect();
}
public function getResponsesByIdListCandidate(array $listResponsesOfCandidateId): array

Loading…
Cancel
Save