bbj-web

Updated: 2025-09-21

BBJ PHP client — quick notes

  • Built a web client that mirrors urwid’s behavior (PHP 8.3, Composer/PSR-4, Guzzle, Dotenv, Monolog).
  • Auth: sends User/Auth (SHA-256). Header shows Login/Register when logged out, New Thread/Logout when in.
  • Anonymous read-only supported (toggle) — blocks POSTs and hides reply/compose.
  • Thread list shows post counts + last updated. Added a tiny file cache (storage/cache/indexmeta.json) with TTL (default 1 day) to avoid recomputing; ?refresh=1 forces rebuild.
  • UI: Pinned filter, and thread Prev/Next links.
  • Thread view renders user objects and structured message bodies (segments → text). Raw badge/toggle works.
  • Edit/Delete: cast IDs to ints and preflight canedit + editquery; if server disallows, you get a friendly message.
  • Hardening: one exception class per file for autoload, always send JSON objects ({}) not arrays, accept "error": false, align params to threadid/postid/value.
  • Settings (env, defaults keep current behavior):
  • BBJANONREADONLY=true|false
  • BBJALLOWREGISTER=true|false
  • BBJALLOWEDITDELETE=true|false
  • BBJINDEXCACHE_TTL=86400

That’s it—modern PHP wrapper around BBJ, cautious by default, and no existing functionality changed by default.

← All notes