public class DataBase : MonoBehaviour
{
public List<Item> items = new List<Item>();
}
class DbConnection
{
private string $host;
private string $port;
private string $login;
private string $password;
private string $db;
private string $authme_table;
public function __construct(string $host, string $port, string $login, string $password, string $db, string $authme_table)
{
$this->host = $host;
$this->port = $port;
$this->login = $login;
$this->password = $password;
$this->db = $db;
$this->authme_table = $authme_table;
}
}
abstract class AuthMeController
{
private DbConnection $dbConnection;
public function __construct(DbConnection $connection)
{
$this->dbConnection = $connection;
}
$dbSettings = include('/engine/data/dbconfig.php');
$connection = new DbConnection($dbSettings['host'], $dbSettings['port'], $dbSettings['login'], $dbSettings['password'], $dbSettings['db'], $dbSettings['authme_table']);
$controller = new AuthController($connection);\
const HOST = $host;
const USERNAME = $user;
const PASSWORD = $password;
const DATABASE = $db;
const AUTHME_TABLE = $authme_table;