The boot guard reported every failed resource behind a full-screen
#boot-error panel. Cloudflare injects beacon.min.js at the edge, and ad
blockers and filtering DNS block it routinely, so a blocked analytics
script painted "CourseHub failed to start" over an app that had started
fine.
Mark the resources we actually ship with data-boot-critical and ignore
the rest, and stop showing the panel once app.js has a UI on screen —
that also keeps a late unhandled rejection (a dropped fetch in loadMeta,
a flaky scan) from covering a running app. A genuine failure of app.js
itself still reports as before.
Claude-Session: https://claude.ai/code/session_01TD5SRevPpgFguCwzNv9ZR7
A browser or CDN holding an assets/app.js from before the shell's element
IDs were renamed runs it against the newer index.php, where it grabs
btn-logout/btn-rescan/nav-user/nav-username/app — all now null — and throws
before it can unhide #app-shell. The result is a blank page whose only clue
is a TypeError in the console.
- index.php: asset() stamps local css/js with the file mtime, so a deploy is
a new URL and a stale copy can't be paired with a newer shell.
- index.php: install an error handler ahead of every other script (capture
phase, so failed resource loads are caught too) that paints uncaught
errors, rejections and load failures into a #boot-error panel. It works
even when app.js itself is what failed, which is this case.
- includes/db.php: add a register_shutdown_function fatal handler, since
set_exception_handler never sees parse errors, exhausted memory or a
failed require — those were ending requests with an empty body. Both
handlers flush partial output and answer in JSON; display_errors stays off
so a warning can't corrupt a JSON body.
- New optional DEBUG config flag adds exception type, file:line and trace to
those responses. config.php is gitignored, so installs without the setting
default to false.
Claude-Session: https://claude.ai/code/session_014oyi9DMdhALrGz989MNNZJ
Course cards go back to the colour-block art that previously sat under the
captured frame, so the UI is unchanged apart from losing the photo.
- Drop thumb.php, generateThumbnails(), captureThumbnail() and
ensureThumbnailColumns(), plus the first-video tracking the scanner only
kept to pick a frame source.
- Drop the ffprobe fallback in probeDuration(); the pure-PHP mvhd parse is
now the only scan-time probe, with the player's report on first play as
the remaining fallback.
- Drop THUMBNAILS_DIR/THUMBNAIL_SEEK_PERCENT from config, the
thumbnail_* columns from schema.sql, the thumbnail counters from scan
output, .thumb img from the stylesheet, and the matching README parts.
Existing databases keep two now-unused folders.thumbnail_* columns; they
are inert and can be dropped by hand if wanted.
Claude-Session: https://claude.ai/code/session_014oyi9DMdhALrGz989MNNZJ
Scanner indexes quiz files found next to videos ([&] questions, "- "
options, "-- Correct" markers; _notsolved twins ignored). Quizzes appear
in the folder content list interleaved with videos by filename order.
New api/quiz.php serves questions without answers and grades attempts
server-side; per-user best/last score and attempts stored in
quiz_progress. Folder/course progress now aggregates videos + quizzes
with partial credit for partial scores.
registerUser() declared `: string|true`; the bare `true` type requires
PHP 8.2, so including auth.php was a fatal error on PHP 8.0/8.1 — every
login/API call returned 500 while install.php (which doesn't include
auth.php) worked. Use string|bool instead. Also install a JSON exception
handler so future server errors surface a message to the SPA instead of
a blank 500.
install.php now takes the videos path (form field / --videos= CLI flag),
persists it into config.php, and creates the directory if missing.
config.example.php default changed from a dev path to /srv/courses.
Creates config.php from the example if missing, creates the database
(and app DB user when admin credentials are given), applies schema.sql
idempotently, optionally creates the first login account, and locks
itself with .install.lock after a successful run.
Scans nested course folders for mp4s, tracks per-user resume position
and per-folder progress. SPA frontend with hash routing over a JSON API;
range-request streaming via stream.php.