c1
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
// Используем для подключения к базе данных MySQL
|
||||
class Database
|
||||
{
|
||||
// Учётные данные базы данных
|
||||
private $host = "mysql:3306";
|
||||
private $db_name = "authentication_jwt";
|
||||
private $username = "tsduser";
|
||||
private $password = "sdWs@a201!";
|
||||
public $conn;
|
||||
|
||||
// Получаем соединение с базой данных
|
||||
public function getConnection()
|
||||
{
|
||||
$this->conn = null;
|
||||
|
||||
try {
|
||||
$this->conn = new PDO("mysql:host=" . $this->host . ";dbname=" . $this->db_name, $this->username, $this->password);
|
||||
} catch (PDOException $exception) {
|
||||
echo "Ошибка соединения с БД: " . $exception->getMessage();
|
||||
}
|
||||
|
||||
return $this->conn;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
// Используем для подключения к базе данных MySQL
|
||||
class Database
|
||||
{
|
||||
// Учётные данные базы данных
|
||||
//private $host = "localhost:3308";
|
||||
private $host = "10.10.1.246";
|
||||
public $db_name = "authentication_jwt";
|
||||
//private $username = "tsd_user";
|
||||
private $username = "tsd";
|
||||
//private $password = "Dfrgvm3@1";
|
||||
private $password = "gcIL6UrWFtSdDTbz";
|
||||
|
||||
|
||||
public $conn;
|
||||
|
||||
// Получаем соединение с базой данных
|
||||
public function getConnection()
|
||||
{
|
||||
$this->conn = null;
|
||||
|
||||
try {
|
||||
$this->conn = new PDO("pgsql:host=".$this->host.";port=5432;dbname=".$this->db_name, $this->username, $this->password);
|
||||
//$this->conn = new PDO("mysql:host=" . $this->host . ";dbname=" . $this->db_name.";charset=UTF8", $this->username, $this->password);
|
||||
} catch (PDOException $exception) {
|
||||
echo "Ошибка соединения с БД: " . $exception->getMessage();
|
||||
}
|
||||
|
||||
return $this->conn;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
// Показ сообщений об ошибках
|
||||
error_reporting(E_ALL);
|
||||
|
||||
// Установим часовой пояс по умолчанию
|
||||
date_default_timezone_set("Europe/Moscow");
|
||||
|
||||
// Переменные, используемые для JWT
|
||||
$key = "d;rflgmd;lthkr;tlgd';tglldkfdfbkjldkaJNLKJDLKJDL2392093420lskfgj!!2";
|
||||
$iss = "https://tsd.book-online.ru";
|
||||
$aud = "https://tsd.book-online.ru";
|
||||
//$iat = 1356999524;
|
||||
//$nbf = 1357000000;
|
||||
$iat = time();
|
||||
$nbf = time();
|
||||
Reference in New Issue
Block a user