|
|
@ -2,6 +2,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
namespace Config;
|
|
|
|
namespace Config;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
use ExceptionHandle\PDOError;
|
|
|
|
use PDOException;
|
|
|
|
use PDOException;
|
|
|
|
|
|
|
|
|
|
|
|
require_once __DIR__ ."/Connection.php";
|
|
|
|
require_once __DIR__ ."/Connection.php";
|
|
|
@ -13,6 +14,9 @@ class ConnectClass{
|
|
|
|
private string $password;
|
|
|
|
private string $password;
|
|
|
|
|
|
|
|
|
|
|
|
function __construct(){
|
|
|
|
function __construct(){
|
|
|
|
|
|
|
|
if ($_ENV["HOST"] == null || $_ENV["DATABASE"] == null || $_ENV["USER"] == null || $_ENV["PASSWORD"] == null){
|
|
|
|
|
|
|
|
throw new PDOException("ENV variable not found");
|
|
|
|
|
|
|
|
}
|
|
|
|
$this->dsn = "mysql:host=".$_ENV["HOST"].";dbname=".$_ENV["DATABASE"].";charset=UTF8";
|
|
|
|
$this->dsn = "mysql:host=".$_ENV["HOST"].";dbname=".$_ENV["DATABASE"].";charset=UTF8";
|
|
|
|
$this->login = $_ENV["USER"];
|
|
|
|
$this->login = $_ENV["USER"];
|
|
|
|
$this->password = $_ENV["PASSWORD"];
|
|
|
|
$this->password = $_ENV["PASSWORD"];
|
|
|
|