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