feat : DATA_PATH configurable, DataGit auto-commit, UpdateChecker branche (v1.4.0)

- DATA_PATH : chemin /data hors document root, configurable via .env
  (fallback sur BASE_PATH/data si absent)
- DataGit : auto-commit git sur toutes les écritures articles/livres
  (create, update, delete, meta, tags, fichiers, liens…) sauf autosave
- UpdateChecker : getBranch() / getLastChecked() / clearCache(),
  branche configurable via FOLIO_UPDATE_BRANCH (plus de main hardcodé)
- Admin dashboard : affiche la branche suivie, date du dernier contrôle,
  bouton Vérifier pour forcer le check sans attendre le TTL
- CLAUDE.md : architecture DATA_PATH et flux de déploiement documentés

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-15 09:17:55 +02:00
parent 55a2120be1
commit 16965ee8cb
18 changed files with 236 additions and 37 deletions
+5 -2
View File
@@ -4,7 +4,7 @@ declare(strict_types=1);
class BookManager
{
public function __construct(private string $booksDir)
public function __construct(private string $booksDir, private ?DataGit $git = null)
{
}
@@ -95,14 +95,17 @@ class BookManager
$this->bookPath($slug),
json_encode($book, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . "\n"
);
$this->git?->commit("book: " . ($book['title'] ?? $slug));
}
public function delete(string $slug): void
{
$path = $this->bookPath($slug);
$title = $this->getBySlug($slug)['title'] ?? $slug;
$path = $this->bookPath($slug);
if (file_exists($path)) {
@unlink($path);
}
$this->git?->commit("delete-book: $title");
}
// ------------------------------------------------------------------ //