You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
SAE4.01_FORMULAIRE/Source/API/script/Config/config.php

24 lines
449 B

<?php
use API\script\Config\Connection;
require_once __DIR__ ."/Connection.php";
function connect()
{
$dsn = "mysql:host=".$_ENV["HOST"].";dbname=".$_ENV["DATABASE"].";";
$login = $_ENV["USER"];
$password = $_ENV["PASSWORD"];
try {
$connection = new Connection($dsn,$login,$password);
} catch (PDOException $e){
http_response_code(404);
return http_response_code();
}
return $connection;
}