From e45cc654c383a9e28f68bf466034556bd235f3f2 Mon Sep 17 00:00:00 2001 From: "dorian.hodin" Date: Thu, 2 Mar 2023 11:48:02 +0100 Subject: [PATCH] TEMP : update some route with composer.json, modify the config.php file all the gateways call --- Source/API/script/Config/composer.json | 4 ++- Source/API/script/Config/config.php | 31 ++++++++++++------- Source/API/script/Gateway/GatewayForm.php | 3 +- Source/API/script/Gateway/GatewayKeyword.php | 3 +- .../GatewayListResponseOfCandidate.php | 3 +- .../Gateway/GatewayPossibleResponse.php | 3 +- Source/API/script/Gateway/GatewayQuestion.php | 3 +- Source/API/script/Gateway/GatewayResponse.php | 3 +- 8 files changed, 34 insertions(+), 19 deletions(-) diff --git a/Source/API/script/Config/composer.json b/Source/API/script/Config/composer.json index 4baef1f..7affc9e 100644 --- a/Source/API/script/Config/composer.json +++ b/Source/API/script/Config/composer.json @@ -10,7 +10,9 @@ "autoload": { "psr-4": { "ExceptionHandle\\" : "../ExceptionHandle", - "Gateway\\" : "../Gateway" + "Gateway\\" : "../Gateway", + "Config\\" : "../Config", + "Connect\\" : "../Config" } } } diff --git a/Source/API/script/Config/config.php b/Source/API/script/Config/config.php index 4f59321..5cb70b7 100644 --- a/Source/API/script/Config/config.php +++ b/Source/API/script/Config/config.php @@ -1,26 +1,33 @@ connection = connect(); + $this->connection = (new ConnectClass)->connect(); } public function insertForm(array $parameters): void diff --git a/Source/API/script/Gateway/GatewayKeyword.php b/Source/API/script/Gateway/GatewayKeyword.php index 4e1def3..3e8305d 100644 --- a/Source/API/script/Gateway/GatewayKeyword.php +++ b/Source/API/script/Gateway/GatewayKeyword.php @@ -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 diff --git a/Source/API/script/Gateway/GatewayListResponseOfCandidate.php b/Source/API/script/Gateway/GatewayListResponseOfCandidate.php index 6c38a15..dee9736 100644 --- a/Source/API/script/Gateway/GatewayListResponseOfCandidate.php +++ b/Source/API/script/Gateway/GatewayListResponseOfCandidate.php @@ -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 diff --git a/Source/API/script/Gateway/GatewayPossibleResponse.php b/Source/API/script/Gateway/GatewayPossibleResponse.php index 0598e9b..22b6ccb 100644 --- a/Source/API/script/Gateway/GatewayPossibleResponse.php +++ b/Source/API/script/Gateway/GatewayPossibleResponse.php @@ -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 diff --git a/Source/API/script/Gateway/GatewayQuestion.php b/Source/API/script/Gateway/GatewayQuestion.php index 8dcb0da..6001ef3 100644 --- a/Source/API/script/Gateway/GatewayQuestion.php +++ b/Source/API/script/Gateway/GatewayQuestion.php @@ -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 diff --git a/Source/API/script/Gateway/GatewayResponse.php b/Source/API/script/Gateway/GatewayResponse.php index a8a5a8d..3dbc276 100644 --- a/Source/API/script/Gateway/GatewayResponse.php +++ b/Source/API/script/Gateway/GatewayResponse.php @@ -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