Итерация 1: каркас Slim 4 приложения

- Slim 4 + php-di контейнер с маршрутизацией
- Docker Compose: app (PHP 8.3-FPM) + web (nginx) + db (MariaDB)
- Phinx миграция: таблица users (uuid, username, password_hash)
- Auth: login/logout с сессиями
- Setup: создание первого пользователя
- Dashboard с layout (Bootstrap 5.3)
- CLI: bin/console, bin/run-scan-worker.php
- Smoke test: scripts/check.sh
- README.md, PLAN.md
This commit is contained in:
2026-05-26 07:26:55 +08:00
commit e7732f5cee
31 changed files with 8790 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
<?php
declare(strict_types=1);
namespace Domovoy\Models;
class User
{
public ?string $id = null;
public string $username = '';
public string $passwordHash = '';
public ?\DateTimeImmutable $createdAt = null;
public ?\DateTimeImmutable $updatedAt = null;
public static function fromArray(array $data): self
{
$user = new self();
$user->id = $data['id'];
$user->username = $data['username'];
$user->passwordHash = $data['password_hash'];
$user->createdAt = new \DateTimeImmutable($data['created_at']);
$user->updatedAt = new \DateTimeImmutable($data['updated_at']);
return $user;
}
}