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": { "autoload": {
"psr-4": { "psr-4": {
"ExceptionHandle\\" : "../ExceptionHandle", "ExceptionHandle\\" : "../ExceptionHandle",
"Gateway\\" : "../Gateway" "Gateway\\" : "../Gateway",
"Config\\" : "../Config",
"Connect\\" : "../Config"
} }
} }
} }

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

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

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

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

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

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

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

Loading…
Cancel
Save