Implermented login
This commit is contained in:
parent
923d6ca242
commit
51c20b55a0
30 changed files with 2495 additions and 39 deletions
21
src/php/Environment/DatabaseEnvironment.php
Normal file
21
src/php/Environment/DatabaseEnvironment.php
Normal 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
|
||||
];
|
||||
}
|
||||
}
|
|
@ -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';
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue