Implermented login

This commit is contained in:
Michel Fedde 2024-06-30 22:29:50 +02:00
parent 923d6ca242
commit 51c20b55a0
30 changed files with 2495 additions and 39 deletions

View file

@ -0,0 +1,21 @@
<?php
declare(strict_types=1);
namespace GamesShop\Environment;
final readonly class DatabaseEnvironment
{
public function __construct(
public string $driver,
public string $path
)
{
}
public function getDoctrineConfig() {
return [
'driver' => $this->driver,
'path' => $this->path
];
}
}

View file

@ -25,4 +25,16 @@ final class EnvironmentHandler
$_SERVER['DISCORD_CLIENT_LOGIN_URI'],
);
}
public function getDatabaseEnvironment(): DatabaseEnvironment
{
return new DatabaseEnvironment(
$_SERVER['DB_DRIVER'],
$_SERVER['DB_PATH']
);
}
public function isProduction(): bool {
return $_SERVER['PRODUCTION'] === 'true';
}
}