Less home code more F3

This commit is contained in:
julien
2026-03-28 23:29:06 +01:00
parent f7480eafe7
commit 1c8c22e12c
12 changed files with 107 additions and 116 deletions

View File

@@ -3,7 +3,6 @@
declare(strict_types=1);
$f3 = require __DIR__ . '/bootstrap.php';
$db = $f3->get('DB');
$username = trim((string) ($argv[1] ?? ''));
if ($username === '') {
@@ -26,10 +25,10 @@ if ($password === '') {
exit(1);
}
User::bootstrap($db);
User::bootstrap($f3->get('DB'));
try {
$id = (new User($db))->create($username, $password);
$id = (new User())->create($username, $password);
fwrite(STDOUT, "Admin créé (ID {$id}).\n");
} catch (RuntimeException $e) {
fwrite(STDERR, $e->getMessage() . "\n");