Less home code more F3
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user